1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-07 22:34:18 +01:00

WPrefs: Move around some options between pages

Move bounce options from expert prefs to its own box on ergonomic
prefs to have them at one place which makes them somewhat more clear.
The options previously occupying this place have been moved to other
pages where they better belong.
This commit is contained in:
BALATON Zoltan
2012-11-14 01:24:06 +01:00
committed by Carlos R. Mafra
parent eb51844fa8
commit 92d52523c4
3 changed files with 56 additions and 42 deletions

View File

@@ -21,6 +21,12 @@
#include "WPrefs.h" #include "WPrefs.h"
#ifdef XKB_MODELOCK
#define NUMITEMS 12
#else
#define NUMITEMS 11
#endif
typedef struct _Panel { typedef struct _Panel {
WMBox *box; WMBox *box;
char *sectionName; char *sectionName;
@@ -31,7 +37,7 @@ typedef struct _Panel {
WMWidget *parent; WMWidget *parent;
WMButton *swi[14]; WMButton *swi[NUMITEMS];
} _Panel; } _Panel;
@@ -51,10 +57,10 @@ static void showData(_Panel * panel)
WMSetButtonSelected(panel->swi[7], GetBoolForKey("SingleClickLaunch")); WMSetButtonSelected(panel->swi[7], GetBoolForKey("SingleClickLaunch"));
WMSetButtonSelected(panel->swi[8], GetBoolForKey("CycleActiveHeadOnly")); WMSetButtonSelected(panel->swi[8], GetBoolForKey("CycleActiveHeadOnly"));
WMSetButtonSelected(panel->swi[9], GetBoolForKey("ShowClipTitle")); WMSetButtonSelected(panel->swi[9], GetBoolForKey("ShowClipTitle"));
WMSetButtonSelected(panel->swi[10], GetBoolForKey("BounceAppIconsWhenUrgent")); WMSetButtonSelected(panel->swi[10], GetBoolForKey("OpaqueMoveResizeKeyboard"));
WMSetButtonSelected(panel->swi[11], GetBoolForKey("RaiseAppIconsWhenBouncing")); #ifdef XKB_MODELOCK
WMSetButtonSelected(panel->swi[12], GetBoolForKey("OpaqueMoveResizeKeyboard")); WMSetButtonSelected(panel->swi[11], GetBoolForKey("KbdModeLock"));
WMSetButtonSelected(panel->swi[13], GetBoolForKey("DoNotMakeAppIconsBounce")); #endif /* XKB_MODELOCK */
} }
static void createPanel(Panel * p) static void createPanel(Panel * p)
@@ -75,10 +81,10 @@ static void createPanel(Panel * p)
WMSetScrollViewHasHorizontalScroller(sv, False); WMSetScrollViewHasHorizontalScroller(sv, False);
f = WMCreateFrame(panel->box); f = WMCreateFrame(panel->box);
WMResizeWidget(f, 495, sizeof(panel->swi) / sizeof(char *) * 25 + 8); WMResizeWidget(f, 495, NUMITEMS * 25 + 8);
WMSetFrameRelief(f, WRFlat); WMSetFrameRelief(f, WRFlat);
for (i = 0; i < sizeof(panel->swi) / sizeof(char *); i++) { for (i = 0; i < NUMITEMS; i++) {
panel->swi[i] = WMCreateSwitchButton(f); panel->swi[i] = WMCreateSwitchButton(f);
WMResizeWidget(panel->swi[i], FRAME_WIDTH - 40, 25); WMResizeWidget(panel->swi[i], FRAME_WIDTH - 40, 25);
WMMoveWidget(panel->swi[i], 5, 5 + i * 25); WMMoveWidget(panel->swi[i], 5, 5 + i * 25);
@@ -95,15 +101,14 @@ static void createPanel(Panel * p)
WMSetButtonText(panel->swi[7], _("Launch applications and restore windows with a single click.")); WMSetButtonText(panel->swi[7], _("Launch applications and restore windows with a single click."));
WMSetButtonText(panel->swi[8], _("Cycle windows only on the active head.")); WMSetButtonText(panel->swi[8], _("Cycle windows only on the active head."));
WMSetButtonText(panel->swi[9], _("Show workspace title on Clip.")); WMSetButtonText(panel->swi[9], _("Show workspace title on Clip."));
WMSetButtonText(panel->swi[10], _("Bounce AppIcons when the application wants attention.")); WMSetButtonText(panel->swi[10], _("Opaque Move,Resize with keyboard."));
WMSetButtonText(panel->swi[11], _("Raise AppIcons when bouncing.")); #ifdef XKB_MODELOCK
WMSetButtonText(panel->swi[12], _("Opaque Move,Resize with keyboard.")); WMSetButtonText(panel->swi[11], _("Enable keyboard language switch button in window titlebars."));
WMSetButtonText(panel->swi[13], _("Do not make AppIcons bounce.")); #endif /* XKB_MODELOCK */
/* If the item is default true, enable the button here */ /* If the item is default true, enable the button here */
WMSetButtonEnabled(panel->swi[6], True); WMSetButtonEnabled(panel->swi[6], True);
WMSetButtonEnabled(panel->swi[9], True); WMSetButtonEnabled(panel->swi[9], True);
WMSetButtonEnabled(panel->swi[10], True);
WMMapSubwidgets(panel->box); WMMapSubwidgets(panel->box);
WMSetScrollViewContentView(sv, WMWidgetView(f)); WMSetScrollViewContentView(sv, WMWidgetView(f));
@@ -128,10 +133,10 @@ static void storeDefaults(_Panel * panel)
SetBoolForKey(WMGetButtonSelected(panel->swi[7]), "SingleClickLaunch"); SetBoolForKey(WMGetButtonSelected(panel->swi[7]), "SingleClickLaunch");
SetBoolForKey(WMGetButtonSelected(panel->swi[8]), "CycleActiveHeadOnly"); SetBoolForKey(WMGetButtonSelected(panel->swi[8]), "CycleActiveHeadOnly");
SetBoolForKey(WMGetButtonSelected(panel->swi[9]), "ShowClipTitle"); SetBoolForKey(WMGetButtonSelected(panel->swi[9]), "ShowClipTitle");
SetBoolForKey(WMGetButtonSelected(panel->swi[10]), "BounceAppIconsWhenUrgent"); SetBoolForKey(WMGetButtonSelected(panel->swi[10]), "OpaqueMoveResizeKeyboard");
SetBoolForKey(WMGetButtonSelected(panel->swi[11]), "RaiseAppIconsWhenBouncing"); #ifdef XKB_MODELOCK
SetBoolForKey(WMGetButtonSelected(panel->swi[12]), "OpaqueMoveResizeKeyboard"); SetBoolForKey(WMGetButtonSelected(panel->swi[11]), "KbdModeLock");
SetBoolForKey(WMGetButtonSelected(panel->swi[13]), "DoNotMakeAppIconsBounce"); #endif /* XKB_MODELOCK */
} }
Panel *InitExpert(WMScreen * scr, WMWidget * parent) Panel *InitExpert(WMScreen * scr, WMWidget * parent)
@@ -143,7 +148,7 @@ Panel *InitExpert(WMScreen * scr, WMWidget * parent)
panel->sectionName = _("Expert User Preferences"); panel->sectionName = _("Expert User Preferences");
panel->description = _("Options for people who know what they're doing...\n" panel->description = _("Options for people who know what they're doing...\n"
"Also have some other misc. options."); "Also has some other misc. options.");
panel->parent = parent; panel->parent = parent;

View File

@@ -47,6 +47,7 @@ typedef struct _Panel {
WMFrame *optF; WMFrame *optF;
WMButton *ignB; WMButton *ignB;
WMButton *newB; WMButton *newB;
WMButton *craisB;
char raiseDelaySelected; char raiseDelaySelected;
} _Panel; } _Panel;
@@ -112,6 +113,7 @@ static void showData(_Panel * panel)
/**/ WMSetButtonSelected(panel->ignB, GetBoolForKey("IgnoreFocusClick")); /**/ WMSetButtonSelected(panel->ignB, GetBoolForKey("IgnoreFocusClick"));
WMSetButtonSelected(panel->newB, GetBoolForKey("AutoFocus")); WMSetButtonSelected(panel->newB, GetBoolForKey("AutoFocus"));
WMSetButtonSelected(panel->craisB, GetBoolForKey("CirculateRaise"));
} }
static void storeData(_Panel * panel) static void storeData(_Panel * panel)
@@ -139,6 +141,7 @@ static void storeData(_Panel * panel)
SetBoolForKey(WMGetButtonSelected(panel->ignB), "IgnoreFocusClick"); SetBoolForKey(WMGetButtonSelected(panel->ignB), "IgnoreFocusClick");
SetBoolForKey(WMGetButtonSelected(panel->newB), "AutoFocus"); SetBoolForKey(WMGetButtonSelected(panel->newB), "AutoFocus");
SetBoolForKey(WMGetButtonSelected(panel->craisB), "CirculateRaise");
} }
static void pushDelayButton(WMWidget * w, void *data) static void pushDelayButton(WMWidget * w, void *data)
@@ -306,14 +309,19 @@ static void createPanel(Panel * p)
panel->ignB = WMCreateSwitchButton(panel->optF); panel->ignB = WMCreateSwitchButton(panel->optF);
WMResizeWidget(panel->ignB, 225, 50); WMResizeWidget(panel->ignB, 225, 50);
WMMoveWidget(panel->ignB, 10, 10); WMMoveWidget(panel->ignB, 10, 4);
WMSetButtonText(panel->ignB, _("Do not let applications receive " "the click used to focus windows.")); WMSetButtonText(panel->ignB, _("Do not let applications receive " "the click used to focus windows."));
panel->newB = WMCreateSwitchButton(panel->optF); panel->newB = WMCreateSwitchButton(panel->optF);
WMResizeWidget(panel->newB, 225, 35); WMResizeWidget(panel->newB, 225, 35);
WMMoveWidget(panel->newB, 10, 70); WMMoveWidget(panel->newB, 10, 44);
WMSetButtonText(panel->newB, _("Automatically focus new windows.")); WMSetButtonText(panel->newB, _("Automatically focus new windows."));
panel->craisB = WMCreateSwitchButton(panel->optF);
WMResizeWidget(panel->craisB, 225, 36);
WMMoveWidget(panel->craisB, 10, 75);
WMSetButtonText(panel->craisB, _("Raise window when switching\nfocus with keyboard."));
WMMapSubwidgets(panel->optF); WMMapSubwidgets(panel->optF);
WMRealizeWidget(panel->box); WMRealizeWidget(panel->box);

View File

@@ -1,4 +1,4 @@
/* Preferences.c- misc personal preferences /* Preferences.c- misc ergonomic preferences
* *
* WPrefs - Window Maker Preferences Program * WPrefs - Window Maker Preferences Program
* *
@@ -42,10 +42,9 @@ typedef struct _Panel {
WMButton *ballB[4]; WMButton *ballB[4];
WMFrame *optF; WMFrame *optF;
WMButton *raisB; WMButton *bounceB;
#ifdef XKB_MODELOCK WMButton *bounceUrgB;
WMButton *modeB; WMButton *bounceRaisB;
#endif /* XKB_MODELOCK */
WMFrame *borderF; WMFrame *borderF;
WMSlider *borderS; WMSlider *borderS;
@@ -127,10 +126,9 @@ static void showData(_Panel * panel)
WMSetButtonSelected(panel->lrB, True); WMSetButtonSelected(panel->lrB, True);
} }
WMSetButtonSelected(panel->raisB, GetBoolForKey("CirculateRaise")); WMSetButtonSelected(panel->bounceB, GetBoolForKey("DoNotMakeAppIconsBounce"));
#ifdef XKB_MODELOCK WMSetButtonSelected(panel->bounceUrgB, GetBoolForKey("BounceAppIconsWhenUrgent"));
WMSetButtonSelected(panel->modeB, GetBoolForKey("KbdModeLock")); WMSetButtonSelected(panel->bounceRaisB, GetBoolForKey("RaiseAppIconsWhenBouncing"));
#endif /* XKB_MODELOCK */
WMSetButtonSelected(panel->ballB[0], GetBoolForKey("WindowTitleBalloons")); WMSetButtonSelected(panel->ballB[0], GetBoolForKey("WindowTitleBalloons"));
WMSetButtonSelected(panel->ballB[1], GetBoolForKey("MiniwindowTitleBalloons")); WMSetButtonSelected(panel->ballB[1], GetBoolForKey("MiniwindowTitleBalloons"));
@@ -191,10 +189,9 @@ static void storeData(_Panel * panel)
SetStringForKey(str, "WorkspaceBorder"); SetStringForKey(str, "WorkspaceBorder");
SetIntegerForKey(WMGetSliderValue(panel->borderS), "WorkspaceBorderSize"); SetIntegerForKey(WMGetSliderValue(panel->borderS), "WorkspaceBorderSize");
SetBoolForKey(WMGetButtonSelected(panel->raisB), "CirculateRaise"); SetBoolForKey(WMGetButtonSelected(panel->bounceB), "DoNotMakeAppIconsBounce");
#ifdef XKB_MODELOCK SetBoolForKey(WMGetButtonSelected(panel->bounceUrgB), "BounceAppIconsWhenUrgent");
SetBoolForKey(WMGetButtonSelected(panel->modeB), "KbdModeLock"); SetBoolForKey(WMGetButtonSelected(panel->bounceRaisB), "RaiseAppIconsWhenBouncing");
#endif /* XKB_MODELOCK */
SetBoolForKey(WMGetButtonSelected(panel->ballB[0]), "WindowTitleBalloons"); SetBoolForKey(WMGetButtonSelected(panel->ballB[0]), "WindowTitleBalloons");
SetBoolForKey(WMGetButtonSelected(panel->ballB[1]), "MiniwindowTitleBalloons"); SetBoolForKey(WMGetButtonSelected(panel->ballB[1]), "MiniwindowTitleBalloons");
SetBoolForKey(WMGetButtonSelected(panel->ballB[2]), "AppIconBalloons"); SetBoolForKey(WMGetButtonSelected(panel->ballB[2]), "AppIconBalloons");
@@ -271,17 +268,21 @@ static void createPanel(Panel * p)
WMResizeWidget(panel->optF, 235, 97); WMResizeWidget(panel->optF, 235, 97);
WMMoveWidget(panel->optF, 270, 128); WMMoveWidget(panel->optF, 270, 128);
panel->raisB = WMCreateSwitchButton(panel->optF); panel->bounceB = WMCreateSwitchButton(panel->optF);
WMResizeWidget(panel->raisB, 210, 36); WMResizeWidget(panel->bounceB, 210, 25);
WMMoveWidget(panel->raisB, 15, 5); WMMoveWidget(panel->bounceB, 15, 8);
WMSetButtonText(panel->raisB, _("Raise window when switching\nfocus with keyboard.")); WMSetButtonText(panel->bounceB, _("Do not make AppIcons bounce."));
#ifdef XKB_MODELOCK panel->bounceUrgB = WMCreateSwitchButton(panel->optF);
panel->modeB = WMCreateSwitchButton(panel->optF); WMResizeWidget(panel->bounceUrgB, 210, 30);
WMResizeWidget(panel->modeB, 210, 40); WMMoveWidget(panel->bounceUrgB, 15, 33);
WMMoveWidget(panel->modeB, 15, 44); WMSetButtonText(panel->bounceUrgB, _("Bounce AppIcons when the application wants attention."));
WMSetButtonText(panel->modeB, _("Enable keyboard language\nswitch button in window titlebars.")); WMSetButtonEnabled(panel->bounceUrgB, True); /* defaults to true */
#endif
panel->bounceRaisB = WMCreateSwitchButton(panel->optF);
WMResizeWidget(panel->bounceRaisB, 210, 25);
WMMoveWidget(panel->bounceRaisB, 15, 64);
WMSetButtonText(panel->bounceRaisB, _("Raise AppIcons when bouncing."));
WMMapSubwidgets(panel->optF); WMMapSubwidgets(panel->optF);