mirror of
https://github.com/gryf/wmaker.git
synced 2026-02-02 22:25:48 +01:00
changed indentation to use spaces only
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
/* MenuPreferences.c- menu related preferences
|
||||
*
|
||||
*
|
||||
* WPrefs - Window Maker Preferences Program
|
||||
*
|
||||
*
|
||||
* Copyright (c) 1998-2003 Alfredo K. Kojima
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
* USA.
|
||||
*/
|
||||
|
||||
@@ -31,16 +31,16 @@ typedef struct _Panel {
|
||||
char *description;
|
||||
|
||||
CallbackRec callbacks;
|
||||
|
||||
|
||||
WMWidget *parent;
|
||||
|
||||
WMFrame *scrF;
|
||||
WMButton *scrB[5];
|
||||
|
||||
|
||||
WMFrame *aliF;
|
||||
WMButton *aliyB;
|
||||
WMButton *alinB;
|
||||
|
||||
|
||||
WMFrame *optF;
|
||||
WMButton *autoB;
|
||||
WMButton *wrapB;
|
||||
@@ -61,14 +61,14 @@ static void
|
||||
showData(_Panel *panel)
|
||||
{
|
||||
WMPerformButtonClick(panel->scrB[GetSpeedForKey("MenuScrollSpeed")]);
|
||||
|
||||
|
||||
if (GetBoolForKey("AlignSubmenus"))
|
||||
WMPerformButtonClick(panel->aliyB);
|
||||
WMPerformButtonClick(panel->aliyB);
|
||||
else
|
||||
WMPerformButtonClick(panel->alinB);
|
||||
|
||||
WMPerformButtonClick(panel->alinB);
|
||||
|
||||
WMSetButtonSelected(panel->wrapB, GetBoolForKey("WrapMenus"));
|
||||
|
||||
|
||||
WMSetButtonSelected(panel->autoB, GetBoolForKey("ScrollableMenus"));
|
||||
}
|
||||
|
||||
@@ -77,10 +77,10 @@ static void
|
||||
storeData(_Panel *panel)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
for (i=0; i<5; i++) {
|
||||
if (WMGetButtonSelected(panel->scrB[i]))
|
||||
break;
|
||||
if (WMGetButtonSelected(panel->scrB[i]))
|
||||
break;
|
||||
}
|
||||
SetSpeedForKey(i, "MenuScrollSpeed");
|
||||
|
||||
@@ -100,52 +100,52 @@ createPanel(Panel *p)
|
||||
int i;
|
||||
char *buf1, *buf2;
|
||||
char *path;
|
||||
|
||||
|
||||
panel->box = WMCreateBox(panel->parent);
|
||||
WMSetViewExpandsToParent(WMWidgetView(panel->box), 2, 2, 2, 2);
|
||||
|
||||
|
||||
/***************** Menu Scroll Speed ****************/
|
||||
panel->scrF = WMCreateFrame(panel->box);
|
||||
WMResizeWidget(panel->scrF, 235, 90);
|
||||
WMMoveWidget(panel->scrF, 25, 20);
|
||||
WMSetFrameTitle(panel->scrF, _("Menu Scrolling Speed"));
|
||||
|
||||
|
||||
|
||||
buf1 = wmalloc(strlen(SPEED_IMAGE)+1);
|
||||
buf2 = wmalloc(strlen(SPEED_IMAGE_S)+1);
|
||||
for (i = 0; i < 5; i++) {
|
||||
panel->scrB[i] = WMCreateCustomButton(panel->scrF, WBBStateChangeMask);
|
||||
WMResizeWidget(panel->scrB[i], 40, 40);
|
||||
WMMoveWidget(panel->scrB[i], 15+(40*i), 30);
|
||||
WMSetButtonBordered(panel->scrB[i], False);
|
||||
WMSetButtonImagePosition(panel->scrB[i], WIPImageOnly);
|
||||
if (i > 0) {
|
||||
WMGroupButtons(panel->scrB[0], panel->scrB[i]);
|
||||
}
|
||||
sprintf(buf1, SPEED_IMAGE, i);
|
||||
sprintf(buf2, SPEED_IMAGE_S, i);
|
||||
path = LocateImage(buf1);
|
||||
if (path) {
|
||||
icon = WMCreatePixmapFromFile(scr, path);
|
||||
if (icon) {
|
||||
WMSetButtonImage(panel->scrB[i], icon);
|
||||
WMReleasePixmap(icon);
|
||||
} else {
|
||||
wwarning(_("could not load icon file %s"), path);
|
||||
}
|
||||
wfree(path);
|
||||
}
|
||||
path = LocateImage(buf2);
|
||||
if (path) {
|
||||
icon = WMCreatePixmapFromFile(scr, path);
|
||||
if (icon) {
|
||||
WMSetButtonAltImage(panel->scrB[i], icon);
|
||||
WMReleasePixmap(icon);
|
||||
} else {
|
||||
wwarning(_("could not load icon file %s"), path);
|
||||
}
|
||||
wfree(path);
|
||||
}
|
||||
panel->scrB[i] = WMCreateCustomButton(panel->scrF, WBBStateChangeMask);
|
||||
WMResizeWidget(panel->scrB[i], 40, 40);
|
||||
WMMoveWidget(panel->scrB[i], 15+(40*i), 30);
|
||||
WMSetButtonBordered(panel->scrB[i], False);
|
||||
WMSetButtonImagePosition(panel->scrB[i], WIPImageOnly);
|
||||
if (i > 0) {
|
||||
WMGroupButtons(panel->scrB[0], panel->scrB[i]);
|
||||
}
|
||||
sprintf(buf1, SPEED_IMAGE, i);
|
||||
sprintf(buf2, SPEED_IMAGE_S, i);
|
||||
path = LocateImage(buf1);
|
||||
if (path) {
|
||||
icon = WMCreatePixmapFromFile(scr, path);
|
||||
if (icon) {
|
||||
WMSetButtonImage(panel->scrB[i], icon);
|
||||
WMReleasePixmap(icon);
|
||||
} else {
|
||||
wwarning(_("could not load icon file %s"), path);
|
||||
}
|
||||
wfree(path);
|
||||
}
|
||||
path = LocateImage(buf2);
|
||||
if (path) {
|
||||
icon = WMCreatePixmapFromFile(scr, path);
|
||||
if (icon) {
|
||||
WMSetButtonAltImage(panel->scrB[i], icon);
|
||||
WMReleasePixmap(icon);
|
||||
} else {
|
||||
wwarning(_("could not load icon file %s"), path);
|
||||
}
|
||||
wfree(path);
|
||||
}
|
||||
}
|
||||
wfree(buf1);
|
||||
wfree(buf2);
|
||||
@@ -153,26 +153,26 @@ createPanel(Panel *p)
|
||||
WMMapSubwidgets(panel->scrF);
|
||||
|
||||
/***************** Submenu Alignment ****************/
|
||||
|
||||
|
||||
panel->aliF = WMCreateFrame(panel->box);
|
||||
WMResizeWidget(panel->aliF, 220, 90);
|
||||
WMMoveWidget(panel->aliF, 280, 20);
|
||||
WMSetFrameTitle(panel->aliF, _("Submenu Alignment"));
|
||||
|
||||
|
||||
panel->alinB = WMCreateButton(panel->aliF, WBTOnOff);
|
||||
WMResizeWidget(panel->alinB, 48, 48);
|
||||
WMMoveWidget(panel->alinB, 56, 25);
|
||||
WMSetButtonImagePosition(panel->alinB, WIPImageOnly);
|
||||
path = LocateImage(MENU_ALIGN1);
|
||||
if (path) {
|
||||
icon = WMCreatePixmapFromFile(scr, path);
|
||||
if (icon) {
|
||||
WMSetButtonImage(panel->alinB, icon);
|
||||
WMReleasePixmap(icon);
|
||||
} else {
|
||||
wwarning(_("could not load icon file %s"), path);
|
||||
}
|
||||
wfree(path);
|
||||
icon = WMCreatePixmapFromFile(scr, path);
|
||||
if (icon) {
|
||||
WMSetButtonImage(panel->alinB, icon);
|
||||
WMReleasePixmap(icon);
|
||||
} else {
|
||||
wwarning(_("could not load icon file %s"), path);
|
||||
}
|
||||
wfree(path);
|
||||
}
|
||||
panel->aliyB = WMCreateButton(panel->aliF, WBTOnOff);
|
||||
WMResizeWidget(panel->aliyB, 48, 48);
|
||||
@@ -180,24 +180,24 @@ createPanel(Panel *p)
|
||||
WMSetButtonImagePosition(panel->aliyB, WIPImageOnly);
|
||||
path = LocateImage(MENU_ALIGN2);
|
||||
if (path) {
|
||||
icon = WMCreatePixmapFromFile(scr, path);
|
||||
if (icon) {
|
||||
WMSetButtonImage(panel->aliyB, icon);
|
||||
WMReleasePixmap(icon);
|
||||
} else {
|
||||
wwarning(_("could not load icon file %s"), path);
|
||||
}
|
||||
wfree(path);
|
||||
icon = WMCreatePixmapFromFile(scr, path);
|
||||
if (icon) {
|
||||
WMSetButtonImage(panel->aliyB, icon);
|
||||
WMReleasePixmap(icon);
|
||||
} else {
|
||||
wwarning(_("could not load icon file %s"), path);
|
||||
}
|
||||
wfree(path);
|
||||
}
|
||||
WMGroupButtons(panel->alinB, panel->aliyB);
|
||||
|
||||
|
||||
WMMapSubwidgets(panel->aliF);
|
||||
|
||||
|
||||
/***************** Options ****************/
|
||||
panel->optF = WMCreateFrame(panel->box);
|
||||
WMResizeWidget(panel->optF, 475, 80);
|
||||
WMMoveWidget(panel->optF, 25, 130);
|
||||
|
||||
|
||||
panel->wrapB = WMCreateSwitchButton(panel->optF);
|
||||
WMResizeWidget(panel->wrapB, 440, 32);
|
||||
WMMoveWidget(panel->wrapB, 25, 8);
|
||||
@@ -207,9 +207,9 @@ createPanel(Panel *p)
|
||||
WMResizeWidget(panel->autoB, 440, 32);
|
||||
WMMoveWidget(panel->autoB, 25, 45);
|
||||
WMSetButtonText(panel->autoB, _("Scroll off-screen menus when pointer is moved over them."));
|
||||
|
||||
|
||||
WMMapSubwidgets(panel->optF);
|
||||
|
||||
|
||||
WMRealizeWidget(panel->box);
|
||||
WMMapSubwidgets(panel->box);
|
||||
|
||||
@@ -229,10 +229,10 @@ InitMenuPreferences(WMScreen *scr, WMWidget *parent)
|
||||
panel->sectionName = _("Menu Preferences");
|
||||
|
||||
panel->description = _("Menu usability related options. Scrolling speed,\n"
|
||||
"alignment of submenus etc.");
|
||||
"alignment of submenus etc.");
|
||||
|
||||
panel->parent = parent;
|
||||
|
||||
|
||||
panel->callbacks.createWidgets = createPanel;
|
||||
panel->callbacks.updateDomain = storeData;
|
||||
|
||||
@@ -240,3 +240,4 @@ InitMenuPreferences(WMScreen *scr, WMWidget *parent)
|
||||
|
||||
return panel;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user