proper logic for using the menu overlap with middle centered submenus.

always center top level menus horizontally under the cursor. why is this not normal behavior..?
This commit is contained in:
Dana Jansens 2007-03-25 17:26:22 +00:00
parent ee58f96a84
commit cbbda7a363

View file

@ -193,7 +193,7 @@ void menu_frame_place_topmenu(ObMenuFrame *self, gint x, gint y)
x = self->client->frame->area.x + self->client->frame->size.left; x = self->client->frame->area.x + self->client->frame->size.left;
y = self->client->frame->area.y + self->client->frame->size.top; y = self->client->frame->area.y + self->client->frame->size.top;
} else { } else {
x -= ob_rr_theme->mbwidth; x -= self->area.width / 2;
y -= ob_rr_theme->mbwidth + self->title_h; y -= ob_rr_theme->mbwidth + self->title_h;
} }
menu_frame_move(self, x, y); menu_frame_move(self, x, y);
@ -205,19 +205,20 @@ void menu_frame_place_submenu(ObMenuFrame *self)
gint overlap; gint overlap;
gint bwidth; gint bwidth;
overlap = (config_menu_middle ? 0 : ob_rr_theme->menu_overlap); overlap = ob_rr_theme->menu_overlap;
bwidth = ob_rr_theme->mbwidth; bwidth = ob_rr_theme->mbwidth;
if (self->direction_right) if (self->direction_right)
x = self->parent->area.x + self->parent->area.width - overlap - bwidth; x = self->parent->area.x + self->parent->area.width - overlap - bwidth;
else else
x = self->parent->area.x - self->area.width + overlap + bwidth; x = self->parent->area.x - self->area.width + overlap + bwidth;
y = self->parent->area.y + self->parent->title_h + y = self->parent->area.y + self->parent->title_h +
self->parent_entry->area.y + overlap; self->parent_entry->area.y;
if (config_menu_middle) if (config_menu_middle)
y = y - (self->area.height - (bwidth * 2) - self->item_h) / 2; y -= (self->area.height - (bwidth * 2) - self->item_h) / 2;
else
y += overlap;
menu_frame_move(self, x, y); menu_frame_move(self, x, y);
} }