summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <m.blumenkran@samsung.com>2013-06-19 08:27:00 +0100
committerMike Blumenkrantz <m.blumenkran@samsung.com>2013-06-19 08:27:00 +0100
commitcf1ccd32f24b389e4254eb7fd048acef23b180a8 (patch)
tree01d61066011ce9e21aa75d628aea54ac14b46b51
parente00459f12e3a801f4e89cce16be1917d34733ea5 (diff)
things that grind my gears: when my shelf config dialogs don't have check changed
Diffstat (limited to '')
-rw-r--r--ChangeLog4
-rw-r--r--NEWS1
-rw-r--r--src/bin/e_int_shelf_config.c38
3 files changed, 38 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index c52ad641b..e04ba3f07 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
12013-06-19 Mike Blumenkrantz
2
3 * added check changed to shelf config dialog
4
12013-06-18 Mike Blumenkrantz 52013-06-18 Mike Blumenkrantz
2 6
3 * fixed crash when multiple windows shared a remember 7 * fixed crash when multiple windows shared a remember
diff --git a/NEWS b/NEWS
index 230da3124..523ecdc81 100644
--- a/NEWS
+++ b/NEWS
@@ -146,6 +146,7 @@ Improvements:
146 * border menu now has top-level item to set borderless state 146 * border menu now has top-level item to set borderless state
147 * added dnd support for text/x-moz-url 147 * added dnd support for text/x-moz-url
148 * filemanager dnd operations now show all files when dragging 148 * filemanager dnd operations now show all files when dragging
149 * added check changed to shelf config dialog
149 150
150Fixes: 151Fixes:
151 * IBar menu didn't allow to configure different icon sources, show contents menu even on empty IBar. 152 * IBar menu didn't allow to configure different icon sources, show contents menu even on empty IBar.
diff --git a/src/bin/e_int_shelf_config.c b/src/bin/e_int_shelf_config.c
index 9cd92802d..2f306514d 100644
--- a/src/bin/e_int_shelf_config.c
+++ b/src/bin/e_int_shelf_config.c
@@ -12,7 +12,7 @@ struct _E_Config_Dialog_Data
12 int orient, fit_along; 12 int orient, fit_along;
13 int size; 13 int size;
14 const char *style; 14 const char *style;
15 int autohide, autohide_action; 15 int autohide, autohide_show_action;
16 double hide_timeout, hide_duration; 16 double hide_timeout, hide_duration;
17 int desk_show_mode; 17 int desk_show_mode;
18 Eina_List *handlers; 18 Eina_List *handlers;
@@ -21,6 +21,7 @@ struct _E_Config_Dialog_Data
21/* local function prototypes */ 21/* local function prototypes */
22static void *_create_data(E_Config_Dialog *cfd); 22static void *_create_data(E_Config_Dialog *cfd);
23static void _fill_data(E_Config_Dialog_Data *cfdata); 23static void _fill_data(E_Config_Dialog_Data *cfdata);
24static int _basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata);
24static void _free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata); 25static void _free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata);
25static Evas_Object *_basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data *cfdata); 26static Evas_Object *_basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data *cfdata);
26static int _basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata); 27static int _basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
@@ -39,6 +40,7 @@ e_int_shelf_config(E_Shelf *es)
39 v->free_cfdata = _free_data; 40 v->free_cfdata = _free_data;
40 v->basic.create_widgets = _basic_create; 41 v->basic.create_widgets = _basic_create;
41 v->basic.apply_cfdata = _basic_apply; 42 v->basic.apply_cfdata = _basic_apply;
43 v->basic.check_changed = _basic_check_changed;
42 44
43 es->config_dialog = 45 es->config_dialog =
44 e_config_dialog_new(es->zone->container, _("Shelf Settings"), 46 e_config_dialog_new(es->zone->container, _("Shelf Settings"),
@@ -103,7 +105,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
103 105
104 /* autohide */ 106 /* autohide */
105 cfdata->autohide = cfdata->escfg->autohide; 107 cfdata->autohide = cfdata->escfg->autohide;
106 cfdata->autohide_action = cfdata->escfg->autohide_show_action; 108 cfdata->autohide_show_action = cfdata->escfg->autohide_show_action;
107 cfdata->hide_timeout = cfdata->escfg->hide_timeout; 109 cfdata->hide_timeout = cfdata->escfg->hide_timeout;
108 cfdata->hide_duration = cfdata->escfg->hide_duration; 110 cfdata->hide_duration = cfdata->escfg->hide_duration;
109 111
@@ -112,6 +114,32 @@ _fill_data(E_Config_Dialog_Data *cfdata)
112 cfdata->desk_list = cfdata->escfg->desk_list; 114 cfdata->desk_list = cfdata->escfg->desk_list;
113} 115}
114 116
117static int
118_basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
119{
120 if (cfdata->escfg->popup)
121 {
122 if (cfdata->layer != 1 + (!!cfdata->escfg->layer)) return 1;
123 }
124 else
125 {
126 if (cfdata->layer) return 1;
127 }
128#define CHECK(X) if (cfdata->X != cfdata->escfg->X) return 1
129 CHECK(overlap);
130 CHECK(orient);
131 CHECK(fit_along);
132 CHECK(size);
133 CHECK(style);
134 CHECK(autohide);
135 CHECK(autohide_show_action);
136 CHECK(desk_show_mode);
137 CHECK(desk_list);
138 if (fabs(cfdata->hide_timeout - cfdata->escfg->hide_timeout > 0.19)) return 1;
139 if (fabs(cfdata->hide_timeout - cfdata->escfg->hide_timeout > 0.04)) return 1;
140 return 0;
141}
142
115static void 143static void
116_free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata) 144_free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
117{ 145{
@@ -213,7 +241,7 @@ _basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data
213 e_widget_on_change_hook_set(cfdata->o_autohide, _cb_autohide_change, cfdata); 241 e_widget_on_change_hook_set(cfdata->o_autohide, _cb_autohide_change, cfdata);
214 e_widget_list_object_append(ol, cfdata->o_autohide, 1, 1, 0.5); 242 e_widget_list_object_append(ol, cfdata->o_autohide, 1, 1, 0.5);
215 243
216 rg = e_widget_radio_group_new(&(cfdata->autohide_action)); 244 rg = e_widget_radio_group_new(&(cfdata->autohide_show_action));
217 ow = e_widget_radio_add(evas, _("Show on mouse in"), 0, rg); 245 ow = e_widget_radio_add(evas, _("Show on mouse in"), 0, rg);
218 e_widget_disabled_set(ow, !cfdata->autohide); 246 e_widget_disabled_set(ow, !cfdata->autohide);
219 cfdata->autohide_list = eina_list_append(cfdata->autohide_list, ow); 247 cfdata->autohide_list = eina_list_append(cfdata->autohide_list, ow);
@@ -324,8 +352,8 @@ _basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
324 } 352 }
325 353
326 cfdata->escfg->overlap = cfdata->overlap; 354 cfdata->escfg->overlap = cfdata->overlap;
327 e_shelf_autohide_set(cfdata->es, cfdata->autohide + (cfdata->autohide * cfdata->autohide_action)); 355 e_shelf_autohide_set(cfdata->es, cfdata->autohide + (cfdata->autohide * cfdata->autohide_show_action));
328 cfdata->escfg->autohide_show_action = cfdata->autohide_action; 356 cfdata->escfg->autohide_show_action = cfdata->autohide_show_action;
329 cfdata->escfg->hide_timeout = cfdata->hide_timeout; 357 cfdata->escfg->hide_timeout = cfdata->hide_timeout;
330 cfdata->escfg->hide_duration = cfdata->hide_duration; 358 cfdata->escfg->hide_duration = cfdata->hide_duration;
331 cfdata->escfg->desk_show_mode = cfdata->desk_show_mode; 359 cfdata->escfg->desk_show_mode = cfdata->desk_show_mode;