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

WPrefs: new Docks pannel, to change auto-expand/collapse/etc delays

This commit is contained in:
Daniel Déchelotte
2013-04-12 01:42:34 +02:00
committed by Carlos R. Mafra
parent d24cbc79ee
commit 5a6e1653ac
8 changed files with 1252 additions and 61 deletions

View File

@@ -44,10 +44,6 @@ typedef struct _Panel {
WMLabel *posiL;
WMLabel *posL;
WMPopUpButton *posP;
WMFrame *dockF;
WMButton *dockB;
WMButton *clipB;
} _Panel;
#define ICON_FILE "workspace"
@@ -57,8 +53,6 @@ typedef struct _Panel {
#define CYCLE_FILE "cycleworkspaces"
#define ADVANCE_FILE "advancetonewworkspace"
#define WSNAME_FILE "workspacename"
#define DOCK_FILE "dock"
#define CLIP_FILE "clip"
static char *WSNamePositions[] = {
"none",
@@ -82,10 +76,6 @@ static void showData(_Panel * panel)
WMSetButtonSelected(panel->newB, GetBoolForKey("AdvanceToNewWorkspace"));
WMSetButtonSelected(panel->dockB, !GetBoolForKey("DisableDock"));
WMSetButtonSelected(panel->clipB, !GetBoolForKey("DisableClip"));
str = GetStringForKey("WorkspaceNameDisplayPosition");
if (!str)
str = "center";
@@ -123,12 +113,12 @@ static void createPanel(Panel * p)
/***************** Workspace Navigation *****************/
panel->navF = WMCreateFrame(panel->box);
WMResizeWidget(panel->navF, 365, 210);
WMResizeWidget(panel->navF, 490, 210);
WMMoveWidget(panel->navF, 15, 10);
WMSetFrameTitle(panel->navF, _("Workspace Navigation"));
panel->cyclB = WMCreateSwitchButton(panel->navF);
WMResizeWidget(panel->cyclB, 280, 34);
WMResizeWidget(panel->cyclB, 410, 34);
WMMoveWidget(panel->cyclB, 75, 30);
WMSetButtonText(panel->cyclB, _("Wrap to the first workspace from the last workspace."));
@@ -144,7 +134,7 @@ static void createPanel(Panel * p)
}
/**/ panel->linkB = WMCreateSwitchButton(panel->navF);
WMResizeWidget(panel->linkB, 280, 34);
WMResizeWidget(panel->linkB, 410, 34);
WMMoveWidget(panel->linkB, 75, 75);
WMSetButtonText(panel->linkB, _("Switch workspaces while dragging windows."));
@@ -160,7 +150,7 @@ static void createPanel(Panel * p)
}
/**/ panel->newB = WMCreateSwitchButton(panel->navF);
WMResizeWidget(panel->newB, 280, 34);
WMResizeWidget(panel->newB, 410, 34);
WMMoveWidget(panel->newB, 75, 120);
WMSetButtonText(panel->newB, _("Automatically create new workspaces."));
@@ -176,10 +166,10 @@ static void createPanel(Panel * p)
}
/**/ panel->posL = WMCreateLabel(panel->navF);
WMResizeWidget(panel->posL, 140, 30);
WMResizeWidget(panel->posL, 200, 30);
WMMoveWidget(panel->posL, 75, 165);
WMSetLabelTextAlignment(panel->posL, WARight);
WMSetLabelText(panel->posL, _("Position of workspace\nname display"));
// WMSetLabelTextAlignment(panel->posL, WARight);
WMSetLabelText(panel->posL, _("Position of workspace name display"));
panel->posiL = WMCreateLabel(panel->navF);
WMResizeWidget(panel->posiL, 60, 40);
@@ -194,7 +184,7 @@ static void createPanel(Panel * p)
panel->posP = WMCreatePopUpButton(panel->navF);
WMResizeWidget(panel->posP, 125, 20);
WMMoveWidget(panel->posP, 225, 175);
WMMoveWidget(panel->posP, 290, 170);
WMAddPopUpButtonItem(panel->posP, _("Disable"));
WMAddPopUpButtonItem(panel->posP, _("Center"));
WMAddPopUpButtonItem(panel->posP, _("Top"));
@@ -206,46 +196,6 @@ static void createPanel(Panel * p)
WMMapSubwidgets(panel->navF);
/***************** Dock/Clip *****************/
panel->dockF = WMCreateFrame(panel->box);
WMResizeWidget(panel->dockF, 115, 210);
WMMoveWidget(panel->dockF, 390, 10);
WMSetFrameTitle(panel->dockF, _("Dock/Clip"));
panel->dockB = WMCreateButton(panel->dockF, WBTToggle);
WMResizeWidget(panel->dockB, 64, 64);
WMMoveWidget(panel->dockB, 25, 35);
WMSetButtonImagePosition(panel->dockB, WIPImageOnly);
CreateImages(scr, rc, xis, DOCK_FILE, &icon1, &icon2);
if (icon2) {
WMSetButtonImage(panel->dockB, icon2);
WMReleasePixmap(icon2);
}
if (icon1) {
WMSetButtonAltImage(panel->dockB, icon1);
WMReleasePixmap(icon1);
}
WMSetBalloonTextForView(_("Disable/enable the application Dock (the\n"
"vertical icon bar in the side of the screen)."), WMWidgetView(panel->dockB));
panel->clipB = WMCreateButton(panel->dockF, WBTToggle);
WMResizeWidget(panel->clipB, 64, 64);
WMMoveWidget(panel->clipB, 25, 120);
WMSetButtonImagePosition(panel->clipB, WIPImageOnly);
CreateImages(scr, rc, xis, CLIP_FILE, &icon1, &icon2);
if (icon2) {
WMSetButtonImage(panel->clipB, icon2);
WMReleasePixmap(icon2);
}
if (icon1) {
WMSetButtonAltImage(panel->clipB, icon1);
WMReleasePixmap(icon1);
}
WMSetBalloonTextForView(_("Disable/enable the Clip (that thing with\n"
"a paper clip icon)."), WMWidgetView(panel->clipB));
WMMapSubwidgets(panel->dockF);
if (xis)
RReleaseImage(xis);
@@ -261,9 +211,6 @@ static void storeData(_Panel * panel)
SetBoolForKey(WMGetButtonSelected(panel->cyclB), "CycleWorkspaces");
SetBoolForKey(WMGetButtonSelected(panel->newB), "AdvanceToNewWorkspace");
SetBoolForKey(!WMGetButtonSelected(panel->dockB), "DisableDock");
SetBoolForKey(!WMGetButtonSelected(panel->clipB), "DisableClip");
SetStringForKey(WSNamePositions[WMGetPopUpButtonSelectedItem(panel->posP)],
"WorkspaceNameDisplayPosition");
}