<warpPointer>yes</warpPointer>
<xorStyle>yes</xorStyle>
<hideDelay>250</hideDelay>
+ <middle>yes</middle>
<submenuShowDelay>0</submenuShowDelay>
<desktopMenuIcons>yes</desktopMenuIcons>
<!-- -->
<xs:element minOccurs="0" name="warpPointer" type="ob:bool"/>
<xs:element minOccurs="0" name="xorStyle" type="ob:bool"/>
<xs:element minOccurs="0" name="hideDelay" type="xs:integer"/>
+ <xs:element minOccurs="0" name="middle" type="ob:bool"/>
<xs:element minOccurs="0" name="submenuShowDelay" type="xs:integer"/>
<xs:element minOccurs="0" name="desktopMenuIcons" type="ob:bool"/>
</xs:sequence>
gboolean config_menu_warppointer;
gboolean config_menu_xorstyle;
guint config_menu_hide_delay;
+gboolean config_menu_middle;
guint config_submenu_show_delay;
gboolean config_menu_client_list_icons;
GSList *config_menu_files;
-gint config_resist_win;
-gint config_resist_edge;
-
+gint config_resist_win;
+gint config_resist_edge;
gboolean config_resist_layers_below;
GSList *config_per_app_settings;
config_menu_xorstyle = parse_bool(doc, n);
if ((n = parse_find_node("hideDelay", node)))
config_menu_hide_delay = parse_int(doc, n);
+ if ((n = parse_find_node("middle", node)))
+ config_menu_middle = parse_bool(doc, n);
if ((n = parse_find_node("submenuShowDelay", node)))
config_submenu_show_delay = parse_int(doc, n);
if ((n = parse_find_node("desktopMenuIcons", node)))
config_menu_warppointer = TRUE;
config_menu_xorstyle = TRUE;
config_menu_hide_delay = 250;
+ config_menu_middle = TRUE;
config_submenu_show_delay = 0;
config_menu_client_list_icons = TRUE;
config_menu_files = NULL;
extern gboolean config_menu_xorstyle;
/*! delay for hiding menu when opening */
extern guint config_menu_hide_delay;
+/*! Center menus vertically about the parent entry */
+extern gboolean config_menu_middle;
/*! delay before opening a submenu */
extern guint config_submenu_show_delay;
/*! show icons in client_list_menu */
menu_frame_update(self);
menu_frame_visible = g_list_prepend(menu_frame_visible, self);
+
+ if (config_menu_middle) {
+ if (self->parent)
+ menu_frame_move(self, self->area.x, self->area.y
+ - self->area.height/2
+ + self->item_h/2);
+ else if (self->show_title)
+ menu_frame_move(self, self->area.x - self->area.width/2,
+ self->area.y - self->title_h*3/4);
+ }
menu_frame_move_on_screen(self);
f = menu_frame_new(self->entry->data.submenu.submenu,
self->frame->client);
menu_frame_move(f,
- self->frame->area.x + self->frame->area.width
- - ob_rr_theme->menu_overlap - ob_rr_theme->bwidth,
- self->frame->area.y + self->frame->title_h +
- self->area.y + ob_rr_theme->menu_overlap);
+ self->frame->area.x
+ + self->frame->area.width
+ - ob_rr_theme->menu_overlap
+ - ob_rr_theme->bwidth,
+ self->frame->area.y
+ + self->frame->title_h
+ + self->area.y
+ + (config_menu_middle ? 1 : ob_rr_theme->menu_overlap));
menu_frame_show(f, self->frame);
}