aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2016-08-13 13:44:22 +0200
committerDave Andreoli <dave@gurumeditation.it>2016-08-13 13:44:22 +0200
commit79979d9d2da86175e6331e565473116d65c230e4 (patch)
tree783ac3d18e5de202912545c7b631b079a61760de
parentNew 1.18 API: elm.Entry.file_text_format (diff)
downloadpython-efl-79979d9d2da86175e6331e565473116d65c230e4.tar.gz
New 1.18 API: elm.Slider.indicator_show_on_focus
with test
-rw-r--r--efl/elementary/slider.pxi21
-rw-r--r--efl/elementary/slider_cdef.pxi2
-rw-r--r--examples/elementary/test_slider.py8
3 files changed, 29 insertions, 2 deletions
diff --git a/efl/elementary/slider.pxi b/efl/elementary/slider.pxi
index 9352886..28b46bd 100644
--- a/efl/elementary/slider.pxi
+++ b/efl/elementary/slider.pxi
@@ -345,7 +345,6 @@ cdef class Slider(LayoutClass):
def indicator_show_get(self):
return bool(elm_slider_indicator_show_get(self.obj))
-
property indicator_visible_mode:
"""The visible mode of indicator
@@ -364,6 +363,25 @@ cdef class Slider(LayoutClass):
def indicator_visible_mode_get(self):
return elm_slider_indicator_visible_mode_get(self.obj)
+ property indicator_show_on_focus:
+ """Whether to show the indicator of the slider on focus.
+
+ :type: bool
+
+ .. versionadded: 1.18
+
+ """
+ def __get__(self):
+ return bool(elm_slider_indicator_show_on_focus_get(self.obj))
+
+ def __set__(self, bint show):
+ elm_slider_indicator_show_on_focus_set(self.obj, show)
+
+ def indicator_show_on_focus_set(self, bint show):
+ elm_slider_indicator_show_on_focus_set(self.obj, show)
+ def indicator_show_on_focus_get(self):
+ return bool(elm_slider_indicator_show_on_focus_get(self.obj))
+
property step:
"""The step by which slider indicator will move.
@@ -388,7 +406,6 @@ cdef class Slider(LayoutClass):
def step_get(self):
return elm_slider_step_get(self.obj)
-
def callback_changed_add(self, func, *args, **kwargs):
"""Whenever the slider value is changed by the user."""
self._callback_add("changed", func, args, kwargs)
diff --git a/efl/elementary/slider_cdef.pxi b/efl/elementary/slider_cdef.pxi
index 0ce485d..311ef65 100644
--- a/efl/elementary/slider_cdef.pxi
+++ b/efl/elementary/slider_cdef.pxi
@@ -29,6 +29,8 @@ cdef extern from "Elementary.h":
Eina_Bool elm_slider_indicator_show_get(const Evas_Object *obj)
void elm_slider_indicator_visible_mode_set(const Evas_Object *obj, Elm_Slider_Indicator_Visible_Mode indicator_visible_mode)
Elm_Slider_Indicator_Visible_Mode elm_slider_indicator_visible_mode_get(const Evas_Object *obj)
+ Eina_Bool elm_slider_indicator_show_on_focus_get(const Evas_Object *obj)
+ void elm_slider_indicator_show_on_focus_set(Evas_Object *obj, Eina_Bool flag)
void elm_slider_step_set(Evas_Object *obj, double step)
double elm_slider_step_get(const Evas_Object *obj)
diff --git a/examples/elementary/test_slider.py b/examples/elementary/test_slider.py
index eb0d9cb..f55bf9e 100644
--- a/examples/elementary/test_slider.py
+++ b/examples/elementary/test_slider.py
@@ -129,6 +129,14 @@ def slider_clicked(obj):
bx.pack_end(sl)
sl.show()
+ # indicator show on focus
+ sl = Slider(bx, text="Indicator on focus", indicator_show_on_focus=True,
+ unit_format="%1.2f units", indicator_format="%1.2f",
+ span_size=120, # this shouldn't be needed, see T4357
+ size_hint_align=FILL_HORIZ, size_hint_weight=EXPAND_HORIZ)
+ bx.pack_end(sl)
+ sl.show()
+
# disabled horizontally inverted slider
ic = Icon(bx, file=os.path.join(img_path, "logo_small.png"),
size_hint_aspect=(EVAS_ASPECT_CONTROL_VERTICAL, 1, 1))