[Xfce4-commits] [xfce/xfwm4] 02/02: Add more accelerators to window menu
noreply at xfce.org
noreply at xfce.org
Wed Apr 29 17:34:57 CEST 2015
This is an automated email from the git hooks/post-receive script.
olivier pushed a commit to branch master
in repository xfce/xfwm4.
commit 34168a96429764c2540e869f111953d504cc22ea
Author: Dr. David Alan Gilbert <dave at treblig.org>
Date: Wed Apr 29 16:10:01 2015 +0100
Add more accelerators to window menu
Bug: 5649
This enables more accelerators on the window menu - i.e. the one you get to
from the titlebar or alt-space.
on top/same/below get T, S and B
On all Visible workspace/on this workspace get V
(with a small change to the text)
Move to another Workspace gets W
The first 9 workspaces now get the accelerators 1..9 on that menu
Signed-off-by: Dr. David Alan Gilbert <dave at treblig.org>
---
src/menu.c | 39 +++++++++++++++++++++++++++++----------
1 file changed, 29 insertions(+), 10 deletions(-)
diff --git a/src/menu.c b/src/menu.c
index d75367f..9dcab0c 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -48,18 +48,18 @@ static MenuItem menuitems[] = {
{MENU_OP_MOVE, NULL, N_("_Move")},
{MENU_OP_RESIZE, NULL, N_("_Resize")},
{0, NULL, NULL}, /* -------------------------------------------------------- */
- {MENU_OP_ABOVE, NULL, N_("Always on Top")},
- {MENU_OP_NORMAL, NULL, N_("Same as Other Windows")},
- {MENU_OP_BELOW, NULL, N_("Always Below Other Windows")},
+ {MENU_OP_ABOVE, NULL, N_("Always on _Top")},
+ {MENU_OP_NORMAL, NULL, N_("_Same as Other Windows")},
+ {MENU_OP_BELOW, NULL, N_("Always _Below Other Windows")},
{MENU_OP_SHADE, "xfce-wm-shade", N_("Roll Window Up")},
{MENU_OP_UNSHADE, "xfce-wm-unshade", N_("Roll Window Down")},
{MENU_OP_FULLSCREEN, "gtk-fullscreen", N_("_Fullscreen")},
{MENU_OP_UNFULLSCREEN, "gtk-fullscreen", N_("Leave _Fullscreen")},
{MENU_OP_CONTEXT_HELP, "gtk-help", N_("Context _Help")},
{0, NULL, NULL}, /* -------------------------------------------------------- */
- {MENU_OP_STICK, "xfce-wm-stick", N_("Always on Visible Workspace")},
- {MENU_OP_UNSTICK, "xfce-wm-unstick", N_("Only on This Workspace")},
- {MENU_OP_WORKSPACES, NULL, N_("Move to Another Workspace")},
+ {MENU_OP_STICK, "xfce-wm-stick", N_("Always on _Visible Workspace")},
+ {MENU_OP_UNSTICK, "xfce-wm-unstick", N_("Only _Visible on This Workspace")},
+ {MENU_OP_WORKSPACES, NULL, N_("Move to Another _Workspace")},
{0, NULL, NULL}, /* -------------------------------------------------------- */
{MENU_OP_DELETE, "xfce-wm-close", N_("_Close")},
#if 0
@@ -181,15 +181,34 @@ menu_workspace (Menu * menu, MenuOp insensitive, gint ws, gint nws, gchar **wsn,
for (i = 0; i < nws; i++)
{
- if ((i < wsn_items) && wsn[i])
+ if ((i < wsn_items) && wsn[i] && *(wsn[i]))
{
- name = g_strdup_printf ("%i (%s)", i+ 1, wsn[i]);
+ if (((i+1) < 10) && (strchr(wsn[i],'_')==NULL))
+ {
+ /* In the 1st 10, there is a name, but it doesn't have _ */
+ name = g_strdup_printf ("_%i (%s)", i + 1, wsn[i]);
+ menuitem = gtk_menu_item_new_with_mnemonic (name);
+ }
+ else
+ {
+ name = g_strdup_printf ("%i (%s)", i + 1, wsn[i]);
+ menuitem = gtk_menu_item_new_with_label (name);
+ }
}
else
{
- name = g_strdup_printf ("%i", i + 1);
+ /* No workspace name */
+ if ((i+1) < 10)
+ {
+ name = g_strdup_printf ("_%i", i + 1);
+ menuitem = gtk_menu_item_new_with_mnemonic (name);
+ }
+ else
+ {
+ name = g_strdup_printf ("%i", i + 1);
+ menuitem = gtk_menu_item_new_with_label (name);
+ }
}
- menuitem = gtk_menu_item_new_with_label (name);
g_free (name);
gtk_widget_set_sensitive (menuitem, !(insensitive & MENU_OP_WORKSPACES) && (i != ws));
gtk_widget_show (menuitem);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list