mirror of
https://github.com/gryf/wmaker.git
synced 2026-03-20 01:33:34 +01:00
Add central position feature for active window
This patch adds a new Central feature under the window menu "Other maximization" entry. Shortcut can be configured via WPrefs "Center active window" action. When called the active window is centered on the screen head. If the window height or width are bigger than the head size, the window is resized to fit. There are some transitions defined as below: *from fullscreen to center *from any corner to center *from top half to center top half *from bottom half to center bottom half *from left half to center left half *from right half to center right half Undoing the action is done via the window menu "Unmaximize" entry or the shortcut.
This commit is contained in:
committed by
Carlos R. Mafra
parent
3344f2b040
commit
ab45c6c6c2
@@ -124,8 +124,9 @@ static const struct {
|
||||
unsigned int shortcut_idx;
|
||||
int maxim_direction;
|
||||
} menu_maximize_entries[] = {
|
||||
{ MI_SNAP_V, N_("Vertically"), WKBD_VMAXIMIZE, MAX_VERTICAL },
|
||||
{ MI_SNAP_H, N_("Horizontally"), WKBD_HMAXIMIZE, MAX_HORIZONTAL },
|
||||
{ MI_SNAP_V, N_("Vertical"), WKBD_VMAXIMIZE, MAX_VERTICAL },
|
||||
{ MI_SNAP_H, N_("Horizontal"), WKBD_HMAXIMIZE, MAX_HORIZONTAL },
|
||||
{ MI_CENTRAL, N_("Central"), WKBD_CENTRAL, MAX_CENTRAL },
|
||||
{ MI_SNAP_LH, N_("Left half"), WKBD_LHMAXIMIZE, MAX_VERTICAL | MAX_LEFTHALF },
|
||||
{ MI_SNAP_RH, N_("Right half"), WKBD_RHMAXIMIZE, MAX_VERTICAL | MAX_RIGHTHALF },
|
||||
{ MI_SNAP_TH, N_("Top half"), WKBD_THMAXIMIZE, MAX_HORIZONTAL | MAX_TOPHALF },
|
||||
@@ -181,7 +182,7 @@ static void updateUnmaximizeShortcut(WMenuEntry * entry, int flags)
|
||||
{
|
||||
int key;
|
||||
|
||||
switch (flags & (MAX_HORIZONTAL | MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_TOPHALF | MAX_BOTTOMHALF | MAX_MAXIMUS)) {
|
||||
switch (flags & (MAX_HORIZONTAL | MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_TOPHALF | MAX_BOTTOMHALF | MAX_MAXIMUS | MAX_CENTRAL)) {
|
||||
case MAX_HORIZONTAL:
|
||||
key = WKBD_HMAXIMIZE;
|
||||
break;
|
||||
@@ -190,6 +191,10 @@ static void updateUnmaximizeShortcut(WMenuEntry * entry, int flags)
|
||||
key = WKBD_VMAXIMIZE;
|
||||
break;
|
||||
|
||||
case MAX_CENTRAL:
|
||||
key = WKBD_CENTRAL;
|
||||
break;
|
||||
|
||||
case MAX_LEFTHALF | MAX_VERTICAL:
|
||||
key = WKBD_LHMAXIMIZE;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user