Reorganize the window menu according to discussion on #110904. The

2003-12-20  Rob Adams  <readams@readams.net>

	Reorganize the window menu according to discussion on #110904.
	The workspace name mnemonic chunk of the patch is thanks to
	Jonathan Blandford.

	* src/common.h: add MENU_OP_ABOVE, MENU_OP_UNABOVE, MENU_UP_MOVE_TO_*
	menu ops.

	* src/core.c (meta_core_get_menu_accelerator): add accelerator for
	the new menu ops.

	* src/menu.c: add checked attribute in _MenuItem struct to display
	a checkmark next to a menu item.  Add the new menu items to
	menuitems.
	(get_workspace_name_with_accel): Add mnemonics even to renamed
	workspaces.
	(menu_item_new): provide support for the checked attribute
	(meta_window_menu_new): construct new submenu for workspace
	switching.

	* src/window.c (menu_callback): implement support for the new menu
	ops.
	(meta_window_show_menu): don't use the OP_*SHAPE operations, and
	compute which of the OP_MOVE_TO_* ops should be used for the
	current workspace and workspace layout.  Add the OP_*ABOVE
	operations.
This commit is contained in:
Rob Adams
2003-12-21 06:31:40 +00:00
committed by Rob Adams
parent 95b0ee480e
commit 690100f1ad
5 changed files with 182 additions and 58 deletions

View File

@@ -586,17 +586,17 @@ meta_core_get_menu_accelerator (MetaMenuOp menu_op,
name = META_KEYBINDING_MAXIMIZE;
break;
case META_MENU_OP_UNSHADE:
name = META_KEYBINDING_TOGGLE_SHADE;
break;
case META_MENU_OP_SHADE:
name = META_KEYBINDING_TOGGLE_SHADE;
break;
case META_MENU_OP_UNSTICK:
name = META_KEYBINDING_TOGGLE_STICKY;
break;
case META_MENU_OP_STICK:
name = META_KEYBINDING_TOGGLE_STICKY;
break;
case META_MENU_OP_ABOVE:
case META_MENU_OP_UNABOVE:
name = META_KEYBINDING_TOGGLE_ABOVE;
break;
case META_MENU_OP_WORKSPACES:
switch (workspace)
{
@@ -644,6 +644,18 @@ meta_core_get_menu_accelerator (MetaMenuOp menu_op,
case META_MENU_OP_RESIZE:
name = META_KEYBINDING_BEGIN_RESIZE;
break;
case META_MENU_OP_MOVE_LEFT:
name = META_KEYBINDING_MOVE_WORKSPACE_LEFT;
break;
case META_MENU_OP_MOVE_RIGHT:
name = META_KEYBINDING_MOVE_WORKSPACE_RIGHT;
break;
case META_MENU_OP_MOVE_UP:
name = META_KEYBINDING_MOVE_WORKSPACE_UP;
break;
case META_MENU_OP_MOVE_DOWN:
name = META_KEYBINDING_MOVE_WORKSPACE_DOWN;
break;
}
if (name)