summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-06-20 01:57:28 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-06-20 01:57:28 +0100
commit949096d0c0faa50cdb867f8a4b1766c52f750431 (patch)
tree8d09f3a6670e7aa0e3ee34a81cf20975e036d436 /src
parentddc9ff72807cfc5274d80f72293b7307850704a2 (diff)
screen setup - put shortcut in config quick-access menu
Diffstat (limited to 'src')
-rw-r--r--src/modules/conf_randr/e_mod_main.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/modules/conf_randr/e_mod_main.c b/src/modules/conf_randr/e_mod_main.c
index b3500feb8..23894b7b6 100644
--- a/src/modules/conf_randr/e_mod_main.c
+++ b/src/modules/conf_randr/e_mod_main.c
@@ -9,6 +9,8 @@ E_API E_Module_Api e_modapi =
9 9
10static Ecore_Event_Handler *randr_event_hand = NULL; 10static Ecore_Event_Handler *randr_event_hand = NULL;
11 11
12static E_Int_Menu_Augmentation *maug[1] = {0};
13
12static Eina_Bool 14static Eina_Bool
13_cb_randr(void *data EINA_UNUSED, int type EINA_UNUSED, void *info EINA_UNUSED) 15_cb_randr(void *data EINA_UNUSED, int type EINA_UNUSED, void *info EINA_UNUSED)
14{ 16{
@@ -27,6 +29,23 @@ _cb_randr(void *data EINA_UNUSED, int type EINA_UNUSED, void *info EINA_UNUSED)
27 return EINA_TRUE; 29 return EINA_TRUE;
28} 30}
29 31
32static void
33_e_mod_run_screen_setup_cb(void *data EINA_UNUSED, E_Menu *m EINA_UNUSED, E_Menu_Item *mi EINA_UNUSED)
34{
35 e_configure_registry_call("screen/screen_setup", NULL, NULL);
36}
37
38static void
39_e_mod_menu_screen_setup_add(void *data EINA_UNUSED, E_Menu *m)
40{
41 E_Menu_Item *mi;
42
43 mi = e_menu_item_new(m);
44 e_menu_item_label_set(mi, _("Screen Setup"));
45 e_util_menu_item_theme_icon_set(mi, "preferences-system-screen-resolution");
46 e_menu_item_callback_set(mi, _e_mod_run_screen_setup_cb, NULL);
47}
48
30E_API void * 49E_API void *
31e_modapi_init(E_Module *m) 50e_modapi_init(E_Module *m)
32{ 51{
@@ -43,6 +62,9 @@ e_modapi_init(E_Module *m)
43 e_int_config_randr2); 62 e_int_config_randr2);
44 randr_event_hand = ecore_event_handler_add(E_EVENT_RANDR_CHANGE, 63 randr_event_hand = ecore_event_handler_add(E_EVENT_RANDR_CHANGE,
45 _cb_randr, NULL); 64 _cb_randr, NULL);
65 maug[0] =
66 e_int_menus_menu_augmentation_add_sorted("config/1", _("Screen Setup"),
67 _e_mod_menu_screen_setup_add, NULL, NULL, NULL);
46 return m; 68 return m;
47} 69}
48 70
@@ -51,6 +73,12 @@ e_modapi_shutdown(E_Module *m EINA_UNUSED)
51{ 73{
52 E_Config_Dialog *cfd; 74 E_Config_Dialog *cfd;
53 75
76 if (maug[0])
77 {
78 e_int_menus_menu_augmentation_del("config/1", maug[0]);
79 maug[0] = NULL;
80 }
81
54 if (randr_event_hand) 82 if (randr_event_hand)
55 { 83 {
56 ecore_event_handler_del(randr_event_hand); 84 ecore_event_handler_del(randr_event_hand);