summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2008-02-11 22:10:21 -0500
committerMikael Magnusson <mikachu@comhem.se>2008-02-14 19:40:02 +0100
commit8186a81fe0095a46c2a65e252268f19d5798095a (patch)
treebb91f3124608f0631f9519586c48a9dda7689764
parent6bda8c29038649f4bd4c54ce011473b1344bb291 (diff)
split menu overlap into x and y components
-rw-r--r--openbox/menuframe.c11
-rw-r--r--render/theme.c11
-rw-r--r--render/theme.h3
3 files changed, 16 insertions, 9 deletions
diff --git a/openbox/menuframe.c b/openbox/menuframe.c
index fb9b6c5b..3bbf1be2 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 9fc1f1db..b1b15ff2 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 2c35284f..3f87ce93 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;