all repos — openbox @ 8186a81fe0095a46c2a65e252268f19d5798095a

openbox fork - make it a bit more like ryudo

split menu overlap into x and y components
Dana Jansens danakj@orodu.net
commit

8186a81fe0095a46c2a65e252268f19d5798095a

parent

6bda8c29038649f4bd4c54ce011473b1344bb291

3 files changed, 16 insertions(+), 9 deletions(-)

jump to
M openbox/menuframe.copenbox/menuframe.c

@@ -249,23 +249,24 @@ }

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,
M render/theme.crender/theme.c

@@ -177,9 +177,14 @@ } else

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;
M render/theme.hrender/theme.h

@@ -45,7 +45,8 @@ gint mbwidth; /*!< menu border width */

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;