Add the manageDesktops option.

This commit is contained in:
Mikael Magnusson 2008-02-03 16:53:33 +01:00
parent 6b04ac47e2
commit 12ca673de5
6 changed files with 28 additions and 9 deletions

View file

@ -622,9 +622,17 @@
<!-- default menu file (or custom one in $HOME/.config/openbox/) -->
<file>menu.xml</file>
<hideDelay>200</hideDelay>
<!-- if a press-release lasts longer than this setting (in milliseconds), the
menu is hidden again -->
<middle>no</middle>
<!-- center submenus vertically about the parent entry -->
<submenuShowDelay>100</submenuShowDelay>
<!-- this one is easy, time to delay before showing a submenu after hovering
over the parent entry -->
<applicationIcons>yes</applicationIcons>
<!-- controls if icons appear in the client-list-(combined-)menu -->
<manageDesktops>yes</manageDesktops>
<!-- show the manage desktops section in the client-list-(combined-)menu -->
</menu>
<applications>

View file

@ -168,6 +168,7 @@
<xsd:element minOccurs="0" name="middle" type="ob:bool"/>
<xsd:element minOccurs="0" name="submenuShowDelay" type="xsd:integer"/>
<xsd:element minOccurs="0" name="applicationIcons" type="ob:bool"/>
<xsd:element minOccurs="0" name="manageDesktops" type="ob:bool"/>
</xsd:complexType>
<xsd:complexType name="window_position">
<xsd:element name="x" type="ob:center_or_int"/>

View file

@ -94,10 +94,12 @@ static gboolean self_update(ObMenuFrame *frame, gpointer data)
}
}
menu_add_separator(menu, SEPARATOR, _("Manage desktops"));
menu_add_normal(menu, ADD_DESKTOP, _("_Add new desktop"), NULL, TRUE);
menu_add_normal(menu, REMOVE_DESKTOP, _("_Remove last desktop"),
NULL, TRUE);
if (config_menu_manage_desktops) {
menu_add_separator(menu, SEPARATOR, _("Manage desktops"));
menu_add_normal(menu, ADD_DESKTOP, _("_Add new desktop"), NULL, TRUE);
menu_add_normal(menu, REMOVE_DESKTOP, _("_Remove last desktop"),
NULL, TRUE);
}
return TRUE; /* always show the menu */
}

View file

@ -153,10 +153,12 @@ static gboolean self_update(ObMenuFrame *frame, gpointer data)
desktop_menus = g_slist_append(desktop_menus, submenu);
}
menu_add_separator(menu, SEPARATOR, NULL);
menu_add_normal(menu, ADD_DESKTOP, _("_Add new desktop"), NULL, TRUE);
menu_add_normal(menu, REMOVE_DESKTOP, _("_Remove last desktop"),
NULL, TRUE);
if (config_menu_manage_desktops) {
menu_add_separator(menu, SEPARATOR, NULL);
menu_add_normal(menu, ADD_DESKTOP, _("_Add new desktop"), NULL, TRUE);
menu_add_normal(menu, REMOVE_DESKTOP, _("_Remove last desktop"),
NULL, TRUE);
}
return TRUE; /* always show */
}

View file

@ -89,6 +89,7 @@ guint config_menu_hide_delay;
gboolean config_menu_middle;
guint config_submenu_show_delay;
gboolean config_menu_client_list_icons;
gboolean config_menu_manage_desktops;
GSList *config_menu_files;
@ -777,6 +778,8 @@ static void parse_menu(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
config_submenu_show_delay = parse_int(doc, n);
if ((n = parse_find_node("applicationIcons", node)))
config_menu_client_list_icons = parse_bool(doc, n);
if ((n = parse_find_node("manageDesktops", node)))
config_menu_manage_desktops = parse_bool(doc, n);
}
}
@ -968,6 +971,7 @@ void config_startup(ObParseInst *i)
config_menu_middle = FALSE;
config_submenu_show_delay = 0;
config_menu_client_list_icons = TRUE;
config_menu_manage_desktops = TRUE;
config_menu_files = NULL;
parse_register(i, "menu", parse_menu, NULL);

View file

@ -177,8 +177,10 @@ extern guint config_menu_hide_delay;
extern gboolean config_menu_middle;
/*! Delay before opening a submenu in milliseconds */
extern guint config_submenu_show_delay;
/*! show icons in client_list_menu */
/*! Show icons in client_list_menu */
extern gboolean config_menu_client_list_icons;
/*! Show manage desktops in client_list_menu */
extern gboolean config_menu_manage_desktops;
/*! User-specified menu files */
extern GSList *config_menu_files;
/*! Per app settings */