1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-25 07:32:36 +01:00

Change Select menu entry text for selected windows.

Other toggle menu items such as Maximize and Shade change their text
labels according to the action which will be performed.  A shaded window
has its Shade menu item text changed to Unshade, for instance.

As well as maintaining consistency with other menu items, changing the
Select menu entry's text to Deselect for current selected windows
provides another (the only) way of reporting that a window is selected
when its border has been disabled.  Currently the only indication that a
window is selected is that its border colour will change.
This commit is contained in:
Iain Patterson
2013-03-26 16:57:05 +00:00
committed by Carlos R. Mafra
parent 17f1eb6568
commit e47413eefd

View File

@@ -551,6 +551,20 @@ static void updateMenuForWindow(WMenu * menu, WWindow * wwin)
wMenuSetEnabled(menu, MC_SHADE, !WFLAGP(wwin, no_shadeable)
&& !wwin->flags.miniaturized);
if (wwin->flags.selected) {
static char *text = NULL;
if (!text)
text = _("Deselect");
menu->entries[MC_SELECT]->text = text;
} else {
static char *text = NULL;
if (!text)
text = _("Select");
menu->entries[MC_SELECT]->text = text;
}
wMenuSetEnabled(menu, MC_DUMMY_MOVETO, !IS_OMNIPRESENT(wwin));
if (!wwin->flags.inspector_open) {
@@ -591,6 +605,7 @@ static WMenu *open_window_menu_core(WWindow *wwin, int x, int y)
wfree(scr->window_menu->entries[MC_MINIATURIZE]->text);
wfree(scr->window_menu->entries[MC_MAXIMIZE]->text);
wfree(scr->window_menu->entries[MC_SHADE]->text);
wfree(scr->window_menu->entries[MC_SELECT]->text);
} else {
updateWorkspaceMenu(scr->workspace_submenu);
}
@@ -685,6 +700,7 @@ void DestroyWindowMenu(WScreen *scr)
scr->window_menu->entries[MC_MINIATURIZE]->text = NULL;
scr->window_menu->entries[MC_MAXIMIZE]->text = NULL;
scr->window_menu->entries[MC_SHADE]->text = NULL;
scr->window_menu->entries[MC_SELECT]->text = NULL;
wMenuDestroy(scr->window_menu, True);
scr->window_menu = NULL;
}