discomfitor pushed a commit to branch master.
commit cf1ccd32f24b389e4254eb7fd048acef23b180a8
Author: Mike Blumenkrantz <[email protected]>
Date: Wed Jun 19 08:27:00 2013 +0100
things that grind my gears: when my shelf config dialogs don't have check
changed
---
ChangeLog | 4 ++++
NEWS | 1 +
src/bin/e_int_shelf_config.c | 38 +++++++++++++++++++++++++++++++++-----
3 files changed, 38 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index c52ad64..e04ba3f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-06-19 Mike Blumenkrantz
+
+ * added check changed to shelf config dialog
+
2013-06-18 Mike Blumenkrantz
* fixed crash when multiple windows shared a remember
diff --git a/NEWS b/NEWS
index 230da31..523ecdc 100644
--- a/NEWS
+++ b/NEWS
@@ -146,6 +146,7 @@ Improvements:
* border menu now has top-level item to set borderless state
* added dnd support for text/x-moz-url
* filemanager dnd operations now show all files when dragging
+ * added check changed to shelf config dialog
Fixes:
* 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 9cd9280..2f30651 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
int orient, fit_along;
int size;
const char *style;
- int autohide, autohide_action;
+ int autohide, autohide_show_action;
double hide_timeout, hide_duration;
int desk_show_mode;
Eina_List *handlers;
@@ -21,6 +21,7 @@ struct _E_Config_Dialog_Data
/* local function prototypes */
static void *_create_data(E_Config_Dialog *cfd);
static void _fill_data(E_Config_Dialog_Data *cfdata);
+static int _basic_check_changed(E_Config_Dialog *cfd __UNUSED__,
E_Config_Dialog_Data *cfdata);
static void _free_data(E_Config_Dialog *cfd __UNUSED__,
E_Config_Dialog_Data *cfdata);
static Evas_Object *_basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas,
E_Config_Dialog_Data *cfdata);
static int _basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data
*cfdata);
@@ -39,6 +40,7 @@ e_int_shelf_config(E_Shelf *es)
v->free_cfdata = _free_data;
v->basic.create_widgets = _basic_create;
v->basic.apply_cfdata = _basic_apply;
+ v->basic.check_changed = _basic_check_changed;
es->config_dialog =
e_config_dialog_new(es->zone->container, _("Shelf Settings"),
@@ -103,7 +105,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
/* autohide */
cfdata->autohide = cfdata->escfg->autohide;
- cfdata->autohide_action = cfdata->escfg->autohide_show_action;
+ cfdata->autohide_show_action = cfdata->escfg->autohide_show_action;
cfdata->hide_timeout = cfdata->escfg->hide_timeout;
cfdata->hide_duration = cfdata->escfg->hide_duration;
@@ -112,6 +114,32 @@ _fill_data(E_Config_Dialog_Data *cfdata)
cfdata->desk_list = cfdata->escfg->desk_list;
}
+static int
+_basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data
*cfdata)
+{
+ if (cfdata->escfg->popup)
+ {
+ if (cfdata->layer != 1 + (!!cfdata->escfg->layer)) return 1;
+ }
+ else
+ {
+ if (cfdata->layer) return 1;
+ }
+#define CHECK(X) if (cfdata->X != cfdata->escfg->X) return 1
+ CHECK(overlap);
+ CHECK(orient);
+ CHECK(fit_along);
+ CHECK(size);
+ CHECK(style);
+ CHECK(autohide);
+ CHECK(autohide_show_action);
+ CHECK(desk_show_mode);
+ CHECK(desk_list);
+ if (fabs(cfdata->hide_timeout - cfdata->escfg->hide_timeout > 0.19)) return
1;
+ if (fabs(cfdata->hide_timeout - cfdata->escfg->hide_timeout > 0.04)) return
1;
+ return 0;
+}
+
static void
_free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
@@ -213,7 +241,7 @@ _basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas,
E_Config_Dialog_Data
e_widget_on_change_hook_set(cfdata->o_autohide, _cb_autohide_change,
cfdata);
e_widget_list_object_append(ol, cfdata->o_autohide, 1, 1, 0.5);
- rg = e_widget_radio_group_new(&(cfdata->autohide_action));
+ rg = e_widget_radio_group_new(&(cfdata->autohide_show_action));
ow = e_widget_radio_add(evas, _("Show on mouse in"), 0, rg);
e_widget_disabled_set(ow, !cfdata->autohide);
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)
}
cfdata->escfg->overlap = cfdata->overlap;
- e_shelf_autohide_set(cfdata->es, cfdata->autohide + (cfdata->autohide *
cfdata->autohide_action));
- cfdata->escfg->autohide_show_action = cfdata->autohide_action;
+ e_shelf_autohide_set(cfdata->es, cfdata->autohide + (cfdata->autohide *
cfdata->autohide_show_action));
+ cfdata->escfg->autohide_show_action = cfdata->autohide_show_action;
cfdata->escfg->hide_timeout = cfdata->hide_timeout;
cfdata->escfg->hide_duration = cfdata->hide_duration;
cfdata->escfg->desk_show_mode = cfdata->desk_show_mode;
--
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev