summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-09-19 19:17:12 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-09-19 19:20:41 +0100
commit3e4ff27c19289b8dc9b196ca7632100a860e64e9 (patch)
treee43fd2c595107cc161c6a05bcb9b677cb65139e8
parent11c0fb01bd891b95931c30dae1d253246064669c (diff)
pager - more direct config from right click menu
-rw-r--r--TODO3
-rw-r--r--src/modules/pager/e_mod_main.c33
2 files changed, 32 insertions, 4 deletions
diff --git a/TODO b/TODO
index 12be817..627398b 100644
--- a/TODO
+++ b/TODO
@@ -147,9 +147,6 @@ TODO:
147* efm: partitioning front end 147* efm: partitioning front end
148* efm: filesystem formatting front-end 148* efm: filesystem formatting front-end
149* efm: tune2fs/fsck front-end 149* efm: tune2fs/fsck front-end
150* pager: add "Set desktop name" on right click on desktop in pager
151 * turn on desktop names when setting one here
152* pager: add "Set wallpaper" on right clikc on desktop in pager
153* start: start menu could do with more featured content 150* start: start menu could do with more featured content
154 * like you see on windows for example (search and multiple columns etc.) 151 * like you see on windows for example (search and multiple columns etc.)
155 * a touch screen android-style scrolling fullscreen app icon style 152 * a touch screen android-style scrolling fullscreen app icon style
diff --git a/src/modules/pager/e_mod_main.c b/src/modules/pager/e_mod_main.c
index a3f00d2..e6fdc1f 100644
--- a/src/modules/pager/e_mod_main.c
+++ b/src/modules/pager/e_mod_main.c
@@ -45,6 +45,9 @@ struct _Pager
45 int xnum, ynum; 45 int xnum, ynum;
46 Eina_List *desks; 46 Eina_List *desks;
47 Pager_Desk *active_pd; 47 Pager_Desk *active_pd;
48 struct {
49 int zone_num, desk_x, desk_y;
50 } menu;
48 unsigned char dragging E_BITFIELD; 51 unsigned char dragging E_BITFIELD;
49 unsigned char just_dragged E_BITFIELD; 52 unsigned char just_dragged E_BITFIELD;
50 Evas_Coord dnd_x, dnd_y; 53 Evas_Coord dnd_x, dnd_y;
@@ -106,6 +109,7 @@ static void _pager_cb_obj_moveresize(void *data, Evas *e EINA_UNUSED
106static void _button_cb_mouse_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info); 109static void _button_cb_mouse_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info);
107static void _pager_inst_cb_menu_configure(void *data EINA_UNUSED, E_Menu *m EINA_UNUSED, E_Menu_Item *mi EINA_UNUSED); 110static void _pager_inst_cb_menu_configure(void *data EINA_UNUSED, E_Menu *m EINA_UNUSED, E_Menu_Item *mi EINA_UNUSED);
108static void _pager_inst_cb_menu_virtual_desktops_dialog(void *data, E_Menu *m EINA_UNUSED, E_Menu_Item *mi EINA_UNUSED); 111static void _pager_inst_cb_menu_virtual_desktops_dialog(void *data, E_Menu *m EINA_UNUSED, E_Menu_Item *mi EINA_UNUSED);
112static void _pager_inst_cb_menu_virtual_desktop_dialog(void *data, E_Menu *m EINA_UNUSED, E_Menu_Item *mi EINA_UNUSED);
109static void _pager_instance_drop_zone_recalc(Instance *inst); 113static void _pager_instance_drop_zone_recalc(Instance *inst);
110static Eina_Bool _pager_cb_event_desk_show(void *data EINA_UNUSED, int type EINA_UNUSED, void *event); 114static Eina_Bool _pager_cb_event_desk_show(void *data EINA_UNUSED, int type EINA_UNUSED, void *event);
111static Eina_Bool _pager_cb_event_desk_name_change(void *data EINA_UNUSED, int type EINA_UNUSED, void *event); 115static Eina_Bool _pager_cb_event_desk_name_change(void *data EINA_UNUSED, int type EINA_UNUSED, void *event);
@@ -876,6 +880,7 @@ _button_cb_mouse_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNU
876 E_Menu *m; 880 E_Menu *m;
877 E_Menu_Item *mi; 881 E_Menu_Item *mi;
878 int cx, cy; 882 int cx, cy;
883 Pager_Desk *pd;
879 884
880 inst = data; 885 inst = data;
881 ev = event_info; 886 ev = event_info;
@@ -889,13 +894,28 @@ _button_cb_mouse_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNU
889 e_menu_item_callback_set(mi, _pager_inst_cb_menu_configure, NULL); 894 e_menu_item_callback_set(mi, _pager_inst_cb_menu_configure, NULL);
890 895
891 m = e_gadcon_client_util_menu_items_append(inst->gcc, m, 0); 896 m = e_gadcon_client_util_menu_items_append(inst->gcc, m, 0);
897
898 mi = e_menu_item_new_relative(m, NULL);
899 e_menu_item_separator_set(mi, 1);
900
892 if (e_configure_registry_exists("screen/virtual_desktops")) 901 if (e_configure_registry_exists("screen/virtual_desktops"))
893 { 902 {
894 mi = e_menu_item_new_relative(m, NULL); 903 mi = e_menu_item_new_relative(m, NULL);
895 e_menu_item_label_set(mi, _("Virtual Desktops Settings")); 904 e_menu_item_label_set(mi, _("All desktop settings"));
896 e_util_menu_item_theme_icon_set(mi, "preferences-desktop"); 905 e_util_menu_item_theme_icon_set(mi, "preferences-desktop");
897 e_menu_item_callback_set(mi, _pager_inst_cb_menu_virtual_desktops_dialog, inst); 906 e_menu_item_callback_set(mi, _pager_inst_cb_menu_virtual_desktops_dialog, inst);
898 } 907 }
908 if (e_configure_registry_exists("internal/desk"))
909 {
910 pd = _pager_desk_at_coord(inst->pager, ev->canvas.x, ev->canvas.y);
911 inst->pager->menu.zone_num = inst->pager->zone->num;
912 inst->pager->menu.desk_x = pd->desk->x;
913 inst->pager->menu.desk_y = pd->desk->y;
914 mi = e_menu_item_new_relative(m, NULL);
915 e_menu_item_label_set(mi, _("This desktop name and wallpaper settings"));
916 e_util_menu_item_theme_icon_set(mi, "preferences-desktop");
917 e_menu_item_callback_set(mi, _pager_inst_cb_menu_virtual_desktop_dialog, inst);
918 }
899 919
900 e_gadcon_canvas_zone_geometry_get(inst->gcc->gadcon, &cx, &cy, 920 e_gadcon_canvas_zone_geometry_get(inst->gcc->gadcon, &cx, &cy,
901 NULL, NULL); 921 NULL, NULL);
@@ -932,6 +952,17 @@ _pager_inst_cb_menu_virtual_desktops_dialog(void *data EINA_UNUSED, E_Menu *m EI
932} 952}
933 953
934static void 954static void
955_pager_inst_cb_menu_virtual_desktop_dialog(void *data, E_Menu *m EINA_UNUSED, E_Menu_Item *mi EINA_UNUSED)
956{
957 Instance *inst = data;
958 char buf[256];
959
960 snprintf(buf, sizeof(buf), "%i %i %i", inst->pager->menu.zone_num,
961 inst->pager->menu.desk_x, inst->pager->menu.desk_y);
962 e_configure_registry_call("internal/desk", NULL, buf);
963}
964
965static void
935_pager_instance_drop_zone_recalc(Instance *inst) 966_pager_instance_drop_zone_recalc(Instance *inst)
936{ 967{
937 Evas_Coord x, y, w, h; 968 Evas_Coord x, y, w, h;