forked from enlightenment/enlightenment
No need to use a switch when detecting mouse button. A simple one-line if
will work instead. SVN revision: 33064
This commit is contained in:
parent
207802377b
commit
a78f33109f
|
@ -280,22 +280,16 @@ _e_toolbar_cb_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_i
|
||||||
|
|
||||||
ev = event_info;
|
ev = event_info;
|
||||||
tbar = data;
|
tbar = data;
|
||||||
switch (ev->button)
|
if (ev->button != 3) return;
|
||||||
{
|
mn = e_menu_new();
|
||||||
case 3:
|
e_menu_post_deactivate_callback_set(mn, _e_toolbar_menu_cb_post, tbar);
|
||||||
mn = e_menu_new();
|
tbar->menu = mn;
|
||||||
e_menu_post_deactivate_callback_set(mn, _e_toolbar_menu_cb_post, tbar);
|
_e_toolbar_menu_append(tbar, mn);
|
||||||
tbar->menu = mn;
|
zone = e_util_zone_current_get(e_manager_current_get());
|
||||||
_e_toolbar_menu_append(tbar, mn);
|
ecore_x_pointer_xy_get(zone->container->win, &x, &y);
|
||||||
zone = e_util_zone_current_get(e_manager_current_get());
|
e_menu_activate_mouse(mn, zone, x, y, 1, 1,
|
||||||
ecore_x_pointer_xy_get(zone->container->win, &x, &y);
|
E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
|
||||||
e_menu_activate_mouse(mn, zone, x, y, 1, 1,
|
e_util_evas_fake_mouse_up_later(tbar->gadcon->evas, ev->button);
|
||||||
E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
|
|
||||||
e_util_evas_fake_mouse_up_later(tbar->gadcon->evas, ev->button);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -376,6 +370,7 @@ _e_toolbar_menu_del_hook(void *data)
|
||||||
E_Menu_Item *mi;
|
E_Menu_Item *mi;
|
||||||
|
|
||||||
mi = l->data;
|
mi = l->data;
|
||||||
|
if (!mi) continue;
|
||||||
if (mi->submenu) e_object_del(E_OBJECT(mi->submenu));
|
if (mi->submenu) e_object_del(E_OBJECT(mi->submenu));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -407,8 +402,7 @@ _e_toolbar_menu_cb_contents(void *data, E_Menu *mn, E_Menu_Item *mi)
|
||||||
E_Toolbar *tbar;
|
E_Toolbar *tbar;
|
||||||
|
|
||||||
tbar = data;
|
tbar = data;
|
||||||
if (!tbar->gadcon->config_dialog)
|
if (!tbar->gadcon->config_dialog) e_int_gadcon_config_toolbar(tbar->gadcon);
|
||||||
e_int_gadcon_config_toolbar(tbar->gadcon);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue