forked from enlightenment/enlightenment
be gone demons of test menu nastiness
fix a few typo bugs on client list menu move client menu to middle click - feel free to slap me down, just think it looks nicer like this SVN revision: 12544
This commit is contained in:
parent
3bebcd6e42
commit
b5c40c9f5a
|
@ -351,112 +351,12 @@ _e_container_cb_bg_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *ev
|
||||||
}
|
}
|
||||||
else if (ev->button == 2)
|
else if (ev->button == 2)
|
||||||
{
|
{
|
||||||
static E_Menu *m = NULL;
|
E_Menu *m;
|
||||||
static E_Menu *m1 = NULL;
|
|
||||||
static E_Menu *m2 = NULL;
|
|
||||||
|
|
||||||
if (!m)
|
m = e_int_menus_clients_new();
|
||||||
{
|
m->con = con;
|
||||||
E_Menu_Item *mi;
|
|
||||||
|
|
||||||
m1 = e_menu_new();
|
|
||||||
mi = e_menu_item_new(m1);
|
|
||||||
e_menu_item_label_set(mi, "Submenu 1 Item 1");
|
|
||||||
mi = e_menu_item_new(m1);
|
|
||||||
e_menu_item_label_set(mi, "Submenu 1 Item 2");
|
|
||||||
mi = e_menu_item_new(m1);
|
|
||||||
e_menu_item_label_set(mi, "Submenu 1 Item 3");
|
|
||||||
|
|
||||||
m2 = e_menu_new();
|
|
||||||
mi = e_menu_item_new(m2);
|
|
||||||
e_menu_item_label_set(mi, "Flimstix");
|
|
||||||
e_menu_item_icon_file_set(mi,
|
|
||||||
e_path_find(path_images, "e.png"));
|
|
||||||
mi = e_menu_item_new(m2);
|
|
||||||
e_menu_item_label_set(mi, "Shub Shub");
|
|
||||||
e_menu_item_icon_file_set(mi,
|
|
||||||
e_path_find(path_images, "e.png"));
|
|
||||||
mi = e_menu_item_new(m2);
|
|
||||||
e_menu_item_label_set(mi, "Gah I thought I'd just make this long");
|
|
||||||
mi = e_menu_item_new(m2);
|
|
||||||
e_menu_item_label_set(mi, "And more");
|
|
||||||
mi = e_menu_item_new(m2);
|
|
||||||
e_menu_item_label_set(mi, "Getting stenchy");
|
|
||||||
mi = e_menu_item_new(m2);
|
|
||||||
e_menu_item_label_set(mi, "Ich bin ein Fisch");
|
|
||||||
mi = e_menu_item_new(m2);
|
|
||||||
e_menu_item_label_set(mi, "PONG");
|
|
||||||
mi = e_menu_item_new(m2);
|
|
||||||
e_menu_item_label_set(mi, "The last word");
|
|
||||||
|
|
||||||
m = e_menu_new();
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_label_set(mi, "First Menu Item");
|
|
||||||
e_menu_item_icon_file_set(mi,
|
|
||||||
e_path_find(path_images, "e.png"));
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_label_set(mi, "Short");
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_label_set(mi, "A very long menu item is here to test with");
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_label_set(mi, "There is no spoon!");
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_label_set(mi, "Icon: Pants On.");
|
|
||||||
e_menu_item_icon_file_set(mi,
|
|
||||||
e_path_find(path_images, "e.png"));
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_label_set(mi, "First Submenu");
|
|
||||||
e_menu_item_submenu_set(mi, m1);
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_separator_set(mi, 1);
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_label_set(mi, "Other side of a separator");
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_label_set(mi, "A Submenu");
|
|
||||||
e_menu_item_icon_file_set(mi,
|
|
||||||
e_path_find(path_images, "e.png"));
|
|
||||||
e_menu_item_submenu_set(mi, m2);
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_check_set(mi, 1);
|
|
||||||
e_menu_item_label_set(mi, "Check 1");
|
|
||||||
e_menu_item_icon_file_set(mi,
|
|
||||||
e_path_find(path_images, "e.png"));
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_check_set(mi, 1);
|
|
||||||
e_menu_item_label_set(mi, "Check 2");
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_check_set(mi, 1);
|
|
||||||
e_menu_item_label_set(mi, "Check 3");
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_separator_set(mi, 1);
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_radio_set(mi, 1);
|
|
||||||
e_menu_item_radio_group_set(mi, 1);
|
|
||||||
e_menu_item_label_set(mi, "Radio 1 Group 1");
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_radio_set(mi, 1);
|
|
||||||
e_menu_item_radio_group_set(mi, 1);
|
|
||||||
e_menu_item_label_set(mi, "Radio 2 Group 1");
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_radio_set(mi, 1);
|
|
||||||
e_menu_item_radio_group_set(mi, 1);
|
|
||||||
e_menu_item_label_set(mi, "Radio 3 Group 1");
|
|
||||||
e_menu_item_icon_file_set(mi,
|
|
||||||
e_path_find(path_images, "e.png"));
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_separator_set(mi, 1);
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_radio_set(mi, 1);
|
|
||||||
e_menu_item_radio_group_set(mi, 2);
|
|
||||||
e_menu_item_label_set(mi, "Radio 1 Group 2");
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_radio_set(mi, 1);
|
|
||||||
e_menu_item_radio_group_set(mi, 2);
|
|
||||||
e_menu_item_label_set(mi, "Radio 2 Group 2");
|
|
||||||
}
|
|
||||||
e_menu_activate_mouse(m, con, ev->output.x, ev->output.y, 1, 1,
|
e_menu_activate_mouse(m, con, ev->output.x, ev->output.y, 1, 1,
|
||||||
E_MENU_POP_DIRECTION_DOWN);
|
E_MENU_POP_DIRECTION_DOWN);
|
||||||
/* fake the up event as we will now grab the mouse to the menu */
|
|
||||||
e_util_container_fake_mouse_up_all_later(con);
|
e_util_container_fake_mouse_up_all_later(con);
|
||||||
}
|
}
|
||||||
else if (ev->button == 3)
|
else if (ev->button == 3)
|
||||||
|
|
|
@ -49,12 +49,6 @@ e_int_menus_about_new(void)
|
||||||
e_menu_item_label_set(mi, "Modules");
|
e_menu_item_label_set(mi, "Modules");
|
||||||
e_menu_item_submenu_set(mi, subm);
|
e_menu_item_submenu_set(mi, subm);
|
||||||
|
|
||||||
subm = e_menu_new();
|
|
||||||
e_menu_pre_activate_callback_set(subm, _e_int_menus_clients_pre_cb, NULL);
|
|
||||||
mi = e_menu_item_new(m);
|
|
||||||
e_menu_item_label_set(mi, "Clients");
|
|
||||||
e_menu_item_submenu_set(mi, subm);
|
|
||||||
|
|
||||||
mi = e_menu_item_new(m);
|
mi = e_menu_item_new(m);
|
||||||
e_menu_item_separator_set(mi, 1);
|
e_menu_item_separator_set(mi, 1);
|
||||||
|
|
||||||
|
@ -88,13 +82,15 @@ e_int_menus_apps_new(char *dir, int top)
|
||||||
}
|
}
|
||||||
|
|
||||||
E_Menu *
|
E_Menu *
|
||||||
e_int_menus_clients_new(char *dir, int top)
|
e_int_menus_clients_new()
|
||||||
{
|
{
|
||||||
E_Menu *m;
|
E_Menu *m;
|
||||||
E_Menu_Item *mi;
|
E_Menu_Item *mi;
|
||||||
|
|
||||||
m = e_menu_new();
|
m = e_menu_new();
|
||||||
|
e_menu_pre_activate_callback_set(m, _e_int_menus_clients_pre_cb, NULL);
|
||||||
|
|
||||||
|
return m;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* local subsystem functions */
|
/* local subsystem functions */
|
||||||
|
@ -230,9 +226,9 @@ _e_int_menus_clients_pre_cb(void *data, E_Menu *m)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get the current containers clients */
|
/* get the current containers clients */
|
||||||
if (m->parent_item && m->parent_item->menu && m->parent_item->menu->con)
|
if (m->con)
|
||||||
{
|
{
|
||||||
for (l = e_container_clients_list_get(m->parent_item->menu->con); l; l = l->next)
|
for (l = e_container_clients_list_get(m->con); l; l = l->next)
|
||||||
{
|
{
|
||||||
borders = evas_list_append(borders, l->data);
|
borders = evas_list_append(borders, l->data);
|
||||||
}
|
}
|
||||||
|
@ -245,6 +241,12 @@ _e_int_menus_clients_pre_cb(void *data, E_Menu *m)
|
||||||
borders = evas_list_append(borders, l->data);
|
borders = evas_list_append(borders, l->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!borders)
|
||||||
|
{ /* FIXME here we want nothing, but that crashes!!! */
|
||||||
|
mi = e_menu_item_new(m);
|
||||||
|
e_menu_item_label_set(mi, "empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
for (l = borders; l; l = l->next)
|
for (l = borders; l; l = l->next)
|
||||||
{
|
{
|
||||||
E_Border *bd = l->data;
|
E_Border *bd = l->data;
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#define E_INT_MENUS_H
|
#define E_INT_MENUS_H
|
||||||
|
|
||||||
EAPI E_Menu *e_int_menus_about_new(void);
|
EAPI E_Menu *e_int_menus_about_new(void);
|
||||||
|
EAPI E_Menu *e_int_menus_client_new(void);
|
||||||
EAPI E_Menu *e_int_menus_apps_new(char *dir, int top);
|
EAPI E_Menu *e_int_menus_apps_new(char *dir, int top);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue