mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +01:00
Add "Center" window placement strategy
Center strategy: try to put window at the center of the usable area. If window would overlap with existing windows, fall back to "Auto" placement strategy. It's very useful for fresh workplaces.
This commit is contained in:
committed by
Carlos R. Mafra
parent
1a594de74e
commit
9d3d34599f
@@ -82,7 +82,8 @@ static char *placements[] = {
|
||||
"random",
|
||||
"manual",
|
||||
"cascade",
|
||||
"smart"
|
||||
"smart",
|
||||
"center"
|
||||
};
|
||||
|
||||
static void sliderCallback(WMWidget * w, void *data)
|
||||
@@ -151,6 +152,8 @@ static int getPlacement(char *str)
|
||||
return 3;
|
||||
else if (strcasecmp(str, "smart") == 0)
|
||||
return 4;
|
||||
else if (strcasecmp(str, "center") == 0)
|
||||
return 5;
|
||||
else
|
||||
wwarning(_("bad option value %s in WindowPlacement. Using default value"), str);
|
||||
return 0;
|
||||
@@ -266,6 +269,7 @@ static void createPanel(Panel * p)
|
||||
WMAddPopUpButtonItem(panel->placP, _("Manual"));
|
||||
WMAddPopUpButtonItem(panel->placP, _("Cascade"));
|
||||
WMAddPopUpButtonItem(panel->placP, _("Smart"));
|
||||
WMAddPopUpButtonItem(panel->placP, _("Center"));
|
||||
|
||||
panel->porigL = WMCreateLabel(panel->placF);
|
||||
WMResizeWidget(panel->porigL, 120, 32);
|
||||
|
||||
Reference in New Issue
Block a user