From 8186a81fe0095a46c2a65e252268f19d5798095a Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Mon, 11 Feb 2008 22:10:21 -0500 Subject: [PATCH] split menu overlap into x and y components --- openbox/menuframe.c | 11 ++++++----- render/theme.c | 11 ++++++++--- render/theme.h | 3 ++- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/openbox/menuframe.c b/openbox/menuframe.c index fb9b6c5..3bbf1be 100644 --- a/openbox/menuframe.c +++ b/openbox/menuframe.c @@ -249,23 +249,24 @@ static void menu_frame_place_topmenu(ObMenuFrame *self, gint *x, gint *y) static void menu_frame_place_submenu(ObMenuFrame *self, gint *x, gint *y) { - gint overlap; + gint overlapx, overlapy; gint bwidth; - overlap = ob_rr_theme->menu_overlap; + overlapx = ob_rr_theme->menu_overlap_x; + overlapy = ob_rr_theme->menu_overlap_y; bwidth = ob_rr_theme->mbwidth; if (self->direction_right) *x = self->parent->area.x + self->parent->area.width - - overlap - bwidth; + overlapx - bwidth; else - *x = self->parent->area.x - self->area.width + overlap + bwidth; + *x = self->parent->area.x - self->area.width + overlapx + bwidth; *y = self->parent->area.y + self->parent_entry->area.y; if (config_menu_middle) *y -= (self->area.height - (bwidth * 2) - ITEM_HEIGHT) / 2; else - *y += overlap; + *y += overlapy; } void menu_frame_move_on_screen(ObMenuFrame *self, gint x, gint y, diff --git a/render/theme.c b/render/theme.c index 9fc1f1d..b1b15ff 100644 --- a/render/theme.c +++ b/render/theme.c @@ -177,9 +177,14 @@ RrTheme* RrThemeNew(const RrInstance *inst, const gchar *name, theme->osd_font = RrFontOpenDefault(inst); /* load direct dimensions */ - if (!read_int(db, "menu.overlap", &theme->menu_overlap) || - theme->menu_overlap < -100 || theme->menu_overlap > 100) - theme->menu_overlap = 0; + if ((!read_int(db, "menu.overlap.x", &theme->menu_overlap_x) && + !read_int(db, "menu.overlap", &theme->menu_overlap_x)) || + theme->menu_overlap_x < -100 || theme->menu_overlap_x > 100) + theme->menu_overlap_x = 0; + if ((!read_int(db, "menu.overlap.y", &theme->menu_overlap_y) && + !read_int(db, "menu.overlap", &theme->menu_overlap_y)) || + theme->menu_overlap_y < -100 || theme->menu_overlap_y > 100) + theme->menu_overlap_y = 0; if (!read_int(db, "window.handle.width", &theme->handle_height) || theme->handle_height < 0 || theme->handle_height > 100) theme->handle_height = 6; diff --git a/render/theme.h b/render/theme.h index 2c35284..3f87ce9 100644 --- a/render/theme.h +++ b/render/theme.h @@ -45,7 +45,8 @@ struct _RrTheme { gint obwidth; /*!< osd border width */ gint cbwidthx; gint cbwidthy; - gint menu_overlap; + gint menu_overlap_x; + gint menu_overlap_y; /* these ones are calculated, not set directly by the theme file */ gint win_font_height; gint menu_title_font_height; -- 1.9.1