diff --git a/WPrefs.app/Icons.c b/WPrefs.app/Icons.c index f0ad10b5..0f067aaa 100644 --- a/WPrefs.app/Icons.c +++ b/WPrefs.app/Icons.c @@ -79,6 +79,7 @@ typedef struct _Panel { WMButton *arrB; WMButton *omnB; WMButton *sclB; + WMButton *marginB; struct { WMFrame *frame; @@ -173,6 +174,7 @@ static void showData(_Panel * panel) WMSetButtonSelected(panel->arrB, GetBoolForKey("AutoArrangeIcons")); WMSetButtonSelected(panel->omnB, GetBoolForKey("StickyIcons")); WMSetButtonSelected(panel->sclB, GetBoolForKey("SingleClickLaunch")); + WMSetButtonSelected(panel->marginB, GetBoolForKey("EnforceIconMargin")); str = GetStringForKey("IconPosition"); if (str != NULL) { @@ -387,7 +389,7 @@ static void createPanel(Panel * p) WMResizeWidget(panel->optF, 215, 148); WMMoveWidget(panel->optF, 292, 72); /* WMSetFrameTitle(panel->optF, _("Icon Display")); */ - starty = 8 + 27; /* the last term centers the checkboxes within the panel; subtract 13 for a new option */ + starty = 8 + 14; /* the last term centers the checkboxes within the panel; subtract 13 for a new option */ panel->arrB = WMCreateSwitchButton(panel->optF); WMResizeWidget(panel->arrB, 198, 26); @@ -413,6 +415,14 @@ static void createPanel(Panel * p) WMSetBalloonTextForView(_("Launch applications and restore windows with a single click."), WMWidgetView(panel->sclB)); + panel->marginB = WMCreateSwitchButton(panel->optF); + WMResizeWidget(panel->marginB, 198, 26); + WMMoveWidget(panel->marginB, 12, starty); + starty += 26; + WMSetButtonText(panel->marginB, _("Enforce icon margin")); + + WMSetBalloonTextForView(_("Make sure that the icon image does not protrude into the icon frame."), WMWidgetView(panel->marginB)); + WMMapSubwidgets(panel->optF); WMRealizeWidget(panel->box); @@ -428,6 +438,7 @@ static void storeData(_Panel * panel) SetBoolForKey(WMGetButtonSelected(panel->arrB), "AutoArrangeIcons"); SetBoolForKey(WMGetButtonSelected(panel->omnB), "StickyIcons"); SetBoolForKey(WMGetButtonSelected(panel->sclB), "SingleClickLaunch"); + SetBoolForKey(WMGetButtonSelected(panel->marginB), "EnforceIconMargin"); SetIntegerForKey(WMGetPopUpButtonSelectedItem(panel->sizeP) * 8 + 24, "IconSize"); diff --git a/src/WindowMaker.h b/src/WindowMaker.h index 90f1d2b3..fb046a2a 100644 --- a/src/WindowMaker.h +++ b/src/WindowMaker.h @@ -376,6 +376,7 @@ extern struct WPreferences { char disable_root_mouse; /* disable button events in root window */ char auto_focus; /* focus window when it's mapped */ char *icon_back_file; /* background image for icons */ + char enforce_icon_margin; /* auto-shrink icon images */ WCoord *root_menu_pos; /* initial position of the root menu*/ WCoord *app_menu_pos; diff --git a/src/defaults.c b/src/defaults.c index 23a0cff9..682f6599 100644 --- a/src/defaults.c +++ b/src/defaults.c @@ -363,6 +363,8 @@ WDefaultEntry optionList[] = { &wPreferences.icon_yard, getEnum, setIconPosition, NULL, NULL}, {"IconificationStyle", "Zoom", seIconificationStyles, &wPreferences.iconification_style, getEnum, NULL, NULL, NULL}, + {"EnforceIconMargin", "NO", NULL, + &wPreferences.enforce_icon_margin, getBool, NULL, NULL, NULL}, {"DisableWSMouseActions", "NO", NULL, &wPreferences.disable_root_mouse, getBool, NULL, NULL, NULL}, {"MouseLeftButtonAction", "SelectWindows", seMouseButtonActions,