Handle menu events a little better: don't bother updating a submenu on

mouseover if it is already open, and call update on menus, even if
they aren't marked as invalid.
This commit is contained in:
Scott Moynes 2003-06-29 01:44:31 +00:00
parent 1ff042579e
commit 71b7b043a2
2 changed files with 5 additions and 8 deletions

View file

@ -436,7 +436,7 @@ void menu_control_mouseover(MenuEntry *self, gboolean enter) {
!= self->parent->open_submenu) != self->parent->open_submenu)
menu_hide(self->parent->open_submenu); menu_hide(self->parent->open_submenu);
if (self->submenu) { if (self->submenu && self->parent->open_submenu != self->submenu) {
self->parent->open_submenu = self->submenu; self->parent->open_submenu = self->submenu;
/* shouldn't be invalid since it must be displayed */ /* shouldn't be invalid since it must be displayed */

View file

@ -7,16 +7,13 @@
void menu_render_full(Menu *self); void menu_render_full(Menu *self);
void menu_render(Menu *self) { void menu_render(Menu *self) {
if (self->invalid) { if (self->update) {
if (self->update) { self->update(self);
self->update(self); } else if (self->invalid) {
} else { menu_render_full(self);
menu_render_full(self);
}
} }
} }
void menu_render_full(Menu *self) { void menu_render_full(Menu *self) {
GList *it; GList *it;
int items_h = 0; int items_h = 0;