aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2013-01-08 11:07:34 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2013-01-08 11:07:34 +0000
commit10c649ccdc4df58e6e520c1ff3b71fead45b7a8f (patch)
treef05347129e41a564d8c3b7269463c5ef9474d362
parent4890358e436dfc50df127da75c4b6d5688701f0d (diff)
downloadenlightenment-10c649ccdc4df58e6e520c1ff3b71fead45b7a8f.tar.gz
enlightenment-10c649ccdc4df58e6e520c1ff3b71fead45b7a8f.tar.xz
enlightenment-10c649ccdc4df58e6e520c1ff3b71fead45b7a8f.zip
backport previous slider commit
SVN revision: 82404
-rw-r--r--ChangeLog2
-rw-r--r--NEWS2
-rw-r--r--src/bin/e_slider.c12
-rw-r--r--src/bin/e_slider.h2
-rw-r--r--src/bin/e_widget_slider.c5
-rw-r--r--src/modules/fileman/e_mod_config.c12
6 files changed, 29 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 122893559..aa657e1d0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
* Fixed bug where keyboard resizing of windows would not be possible if timeout was set to zero
* Fixed crash when clicking apply in wallpaper settings dialog and no wallpaper is selected
+ * Fixed bug where disabled slider widgets could be changed with mouse wheel
+ * Fixed bug where fileman config slider widgets were not properly disabled
2013-01-07 Tom "TAsn" Hacohen
* e_entry + e_scrollable: Fixed issues with smart members.
diff --git a/NEWS b/NEWS
index c7c03c498..bf9449b29 100644
--- a/NEWS
+++ b/NEWS
@@ -21,3 +21,5 @@ Fixes:
* entry/scrollframe: Fixed issues with submembers.
* Fixed bug where keyboard resizing of windows would not be possible if timeout was set to zero
* Fixed crash when clicking apply in wallpaper settings dialog and no wallpaper is selected
+ * Fixed bug where disabled slider widgets could be changed with mouse wheel
+ * Fixed bug where fileman config slider widgets were not properly disabled
diff --git a/src/bin/e_slider.c b/src/bin/e_slider.c
index 566fb222b..44a1df1c8 100644
--- a/src/bin/e_slider.c
+++ b/src/bin/e_slider.c
@@ -23,6 +23,7 @@ struct _E_Smart_Data
Evas_Coord minw, minh;
Ecore_Timer *set_timer;
Eina_List *special_values;
+ Eina_Bool disabled : 1;
};
struct _E_Slider_Special_Value
@@ -205,6 +206,13 @@ e_slider_direction_set(Evas_Object *obj, int reversed)
_e_smart_value_update_now(sd);
}
+EAPI void
+e_slider_disabled_set(Evas_Object *obj, Eina_Bool disable)
+{
+ API_ENTRY return;
+ sd->disabled = disable;
+}
+
EAPI int
e_slider_direction_get(Evas_Object *obj)
{
@@ -397,6 +405,7 @@ _e_smart_signal_cb_wheel_up(void *data, Evas_Object *obj __UNUSED__, const char
{
E_Smart_Data *sd = data;
+ if (sd->disabled) return;
edje_object_part_drag_step(sd->edje_obj, "e.dragable.slider", -0.05, -0.05);
sd->direction = -1;
}
@@ -406,6 +415,7 @@ _e_smart_signal_cb_wheel_down(void *data, Evas_Object *obj __UNUSED__, const cha
{
E_Smart_Data *sd = data;
+ if (sd->disabled) return;
edje_object_part_drag_step(sd->edje_obj, "e.dragable.slider", 0.05, 0.05);
sd->direction = 1;
}
@@ -416,6 +426,7 @@ _e_smart_event_key_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSE
Evas_Event_Key_Down *ev = event_info;
E_Smart_Data *sd = data;
+ if (sd->disabled) return;
if ((!strcmp(ev->keyname, "Up")) ||
(!strcmp(ev->keyname, "KP_Up")) ||
(!strcmp(ev->keyname, "Left")) ||
@@ -467,6 +478,7 @@ _e_smart_event_mouse_down(void *data, Evas *e, Evas_Object *obj __UNUSED__, void
double pos;
static int in_md = 0;
+ if (sd->disabled) return;
if (in_md > 0) return;
in_md++;
evas_object_geometry_get(sd->event, &x, &y, &w, &h);
diff --git a/src/bin/e_slider.h b/src/bin/e_slider.h
index f97a32b7c..2c9ab8b55 100644
--- a/src/bin/e_slider.h
+++ b/src/bin/e_slider.h
@@ -20,7 +20,7 @@ EAPI void e_slider_direction_set (Evas_Object *obj, int rever
EAPI int e_slider_direction_get (Evas_Object *obj);
EAPI void e_slider_size_min_get (Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh);
EAPI Evas_Object *e_slider_edje_object_get (Evas_Object *obj);
-
+EAPI void e_slider_disabled_set(Evas_Object *obj, Eina_Bool disable);
EAPI void e_slider_special_value_add (Evas_Object *obj, double value, double error, const char *label);
#endif
#endif
diff --git a/src/bin/e_widget_slider.c b/src/bin/e_widget_slider.c
index 971899a1b..1808db860 100644
--- a/src/bin/e_widget_slider.c
+++ b/src/bin/e_widget_slider.c
@@ -230,9 +230,12 @@ static void
_e_wid_disable_hook(Evas_Object *obj)
{
E_Widget_Data *wd;
+ Eina_Bool disable;
wd = e_widget_data_get(obj);
- if (e_widget_disabled_get(obj))
+ disable = e_widget_disabled_get(obj);
+ e_slider_disabled_set(wd->o_slider, disable);
+ if (disable)
edje_object_signal_emit(e_slider_edje_object_get(wd->o_slider),
"e,state,disabled", "e");
else
diff --git a/src/modules/fileman/e_mod_config.c b/src/modules/fileman/e_mod_config.c
index c0980fc77..f73832519 100644
--- a/src/modules/fileman/e_mod_config.c
+++ b/src/modules/fileman/e_mod_config.c
@@ -28,7 +28,9 @@ struct _E_Config_Dialog_Data
double delay;
double size;
Eina_Bool enable;
+ Evas_Object *delay_slider_text;
Evas_Object *delay_slider;
+ Evas_Object *size_slider_text;
Evas_Object *size_slider;
} tooltip;
/* display of icons */
@@ -283,7 +285,9 @@ _tooltip_changed(void *data, Evas_Object *obj __UNUSED__)
{
E_Config_Dialog_Data *cfdata = data;
+ e_widget_disabled_set(cfdata->tooltip.delay_slider_text, !cfdata->tooltip.enable);
e_widget_disabled_set(cfdata->tooltip.delay_slider, !cfdata->tooltip.enable);
+ e_widget_disabled_set(cfdata->tooltip.size_slider_text, !cfdata->tooltip.enable);
e_widget_disabled_set(cfdata->tooltip.size_slider, !cfdata->tooltip.enable);
}
@@ -454,15 +458,15 @@ _basic_create(E_Config_Dialog *cfd __UNUSED__,
(int*)&(cfdata->tooltip.enable));
e_widget_on_change_hook_set(ob, _tooltip_changed, cfdata);
e_widget_list_object_append(o, ob, 1, 1, 0.5);
- cfdata->tooltip.delay_slider = ob = e_widget_label_add(evas, _("Tooltip delay"));
+ cfdata->tooltip.delay_slider_text = ob = e_widget_label_add(evas, _("Tooltip delay"));
e_widget_list_object_append(o, ob, 1, 1, 0.5);
- ob = e_widget_slider_add(evas, 1, 0, _("%1.1f"), 0.0, 5.0, 0.5, 0,
+ cfdata->tooltip.delay_slider = ob = e_widget_slider_add(evas, 1, 0, _("%1.1f"), 0.0, 5.0, 0.5, 0,
&cfdata->tooltip.delay, NULL, 150);
e_widget_list_object_append(o, ob, 1, 1, 0.5);
- cfdata->tooltip.size_slider = ob = e_widget_label_add(evas, _("Tooltip size (Screen percentage)"));
+ cfdata->tooltip.size_slider_text = ob = e_widget_label_add(evas, _("Tooltip size (Screen percentage)"));
e_widget_list_object_append(o, ob, 1, 1, 0.5);
- ob = e_widget_slider_add(evas, 1, 0, _("%2.0f"), 10.0, 75.0, 5.0, 0,
+ cfdata->tooltip.size_slider = ob = e_widget_slider_add(evas, 1, 0, _("%2.0f"), 10.0, 75.0, 5.0, 0,
&cfdata->tooltip.size, NULL, 150);
e_widget_list_object_append(o, ob, 1, 1, 0.5);
_tooltip_changed(cfdata, NULL);