add a menuOverlap property to themes, and use it in the submenu placement
This commit is contained in:
parent
463c0004a1
commit
ea6258ce0f
3 changed files with 7 additions and 3 deletions
|
@ -11,7 +11,7 @@
|
||||||
GHashTable *menu_hash = NULL;
|
GHashTable *menu_hash = NULL;
|
||||||
GList *menu_visible = NULL;
|
GList *menu_visible = NULL;
|
||||||
|
|
||||||
#define FRAME_EVENTMASK (ButtonPressMask |ButtonMotionMask | EnterWindowMask | \
|
#define FRAME_EVENTMASK (ButtonPressMask |ButtonMotionMask | EnterWindowMask |\
|
||||||
LeaveWindowMask)
|
LeaveWindowMask)
|
||||||
#define TITLE_EVENTMASK (ButtonPressMask | ButtonMotionMask)
|
#define TITLE_EVENTMASK (ButtonPressMask | ButtonMotionMask)
|
||||||
#define ENTRY_EVENTMASK (EnterWindowMask | LeaveWindowMask | \
|
#define ENTRY_EVENTMASK (EnterWindowMask | LeaveWindowMask | \
|
||||||
|
@ -473,7 +473,7 @@ void menu_control_mouseover(ObMenuEntry *self, gboolean enter)
|
||||||
/* TODO: I don't understand why these bevels should be here.
|
/* TODO: I don't understand why these bevels should be here.
|
||||||
Something must be wrong in the width calculation */
|
Something must be wrong in the width calculation */
|
||||||
x = self->parent->location.x + self->parent->size.width +
|
x = self->parent->location.x + self->parent->size.width +
|
||||||
ob_rr_theme->bwidth;
|
ob_rr_theme->bwidth - ob_rr_theme->menu_overlap;
|
||||||
|
|
||||||
/* need to get the width. is this bad?*/
|
/* need to get the width. is this bad?*/
|
||||||
menu_render(self->submenu);
|
menu_render(self->submenu);
|
||||||
|
@ -482,7 +482,7 @@ void menu_control_mouseover(ObMenuEntry *self, gboolean enter)
|
||||||
|
|
||||||
if (self->submenu->size.width + x >= a->x + a->width)
|
if (self->submenu->size.width + x >= a->x + a->width)
|
||||||
x = self->parent->location.x - self->submenu->size.width -
|
x = self->parent->location.x - self->submenu->size.width -
|
||||||
ob_rr_theme->bwidth;
|
ob_rr_theme->bwidth + ob_rr_theme->menu_overlap;
|
||||||
|
|
||||||
menu_show_full(self->submenu, x,
|
menu_show_full(self->submenu, x,
|
||||||
self->parent->location.y + self->y,
|
self->parent->location.y + self->y,
|
||||||
|
|
|
@ -135,6 +135,9 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
|
||||||
theme->title_layout = g_strdup(font_str);
|
theme->title_layout = g_strdup(font_str);
|
||||||
|
|
||||||
/* load direct dimensions */
|
/* load direct dimensions */
|
||||||
|
if (!read_int(db, "menuOverlap", &theme->menu_overlap) ||
|
||||||
|
theme->menu_overlap < 0 || theme->menu_overlap > 20)
|
||||||
|
theme->handle_height = 0;
|
||||||
if (!read_int(db, "handleWidth", &theme->handle_height) ||
|
if (!read_int(db, "handleWidth", &theme->handle_height) ||
|
||||||
theme->handle_height < 0 || theme->handle_height > 100)
|
theme->handle_height < 0 || theme->handle_height > 100)
|
||||||
theme->handle_height = 6;
|
theme->handle_height = 6;
|
||||||
|
|
|
@ -20,6 +20,7 @@ struct _RrTheme {
|
||||||
gint title_height;
|
gint title_height;
|
||||||
gint button_size;
|
gint button_size;
|
||||||
gint grip_width;
|
gint grip_width;
|
||||||
|
gint menu_overlap;
|
||||||
|
|
||||||
/* style settings - colors */
|
/* style settings - colors */
|
||||||
RrColor *b_color;
|
RrColor *b_color;
|
||||||
|
|
Loading…
Reference in a new issue