summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorHosang Kim <hosang12.kim@samsung.com>2020-01-10 09:26:32 +0000
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-01-17 17:21:09 +0100
commitfbb77e7d1c3116f4187370ec9406755f38cf44be (patch)
tree429f27f90728582e79b9f53248dcab66c2e4cfb2 /src/lib
parentbac185e8f3ed5a17d9c29e5daf2e2038b6734767 (diff)
efl_ui_scrollbar: change scrollbar state when theme is reloaded.
Scrollbar visible state is not synchronized when theme is reloaded. Differential Revision: https://phab.enlightenment.org/D10649
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/efl/interfaces/efl_ui_scrollbar.eo12
-rw-r--r--src/lib/elementary/efl_ui_scroll_manager.c7
-rw-r--r--src/lib/elementary/efl_ui_scroll_manager.eo1
-rw-r--r--src/lib/elementary/efl_ui_scroll_util.c14
4 files changed, 34 insertions, 0 deletions
diff --git a/src/lib/efl/interfaces/efl_ui_scrollbar.eo b/src/lib/efl/interfaces/efl_ui_scrollbar.eo
index 5741df6b8f..3b4696f00b 100644
--- a/src/lib/efl/interfaces/efl_ui_scrollbar.eo
+++ b/src/lib/efl/interfaces/efl_ui_scrollbar.eo
@@ -60,6 +60,18 @@ interface Efl.Ui.Scrollbar
60 and $[1.0] (the bottom side of the thumb is touching the bottom edge of the widget).]] 60 and $[1.0] (the bottom side of the thumb is touching the bottom edge of the widget).]]
61 } 61 }
62 } 62 }
63 @property bar_visibility {
64 [[Current visibility state of the scrollbars.
65 This is useful in @Efl.Ui.Scrollbar_Mode.auto mode where EFL decides if the scrollbars
66 are shown or hidden. See also the @[.bar,show] and @[.bar,hide] events.
67 ]]
68 get {
69 }
70 values {
71 hbar: bool; [[Whether the horizontal scrollbar is currently visible.]]
72 vbar: bool; [[Whether the vertical scrollbar is currently visible.]]
73 }
74 }
63 bar_visibility_update @protected @beta{ 75 bar_visibility_update @protected @beta{
64 [[Update bar visibility. 76 [[Update bar visibility.
65 77
diff --git a/src/lib/elementary/efl_ui_scroll_manager.c b/src/lib/elementary/efl_ui_scroll_manager.c
index 3d332e94fb..650a726bc1 100644
--- a/src/lib/elementary/efl_ui_scroll_manager.c
+++ b/src/lib/elementary/efl_ui_scroll_manager.c
@@ -2188,6 +2188,13 @@ _efl_ui_scrollbar_v_visibility_adjust(Eo *obj)
2188} 2188}
2189 2189
2190EOLIAN static void 2190EOLIAN static void
2191_efl_ui_scroll_manager_efl_ui_scrollbar_bar_visibility_get(const Eo *obj EINA_UNUSED, Efl_Ui_Scroll_Manager_Data *sd, Eina_Bool *hbar, Eina_Bool *vbar)
2192{
2193 if (hbar) *hbar = sd->hbar_visible;
2194 if (vbar) *vbar = sd->vbar_visible;
2195}
2196
2197EOLIAN static void
2191_efl_ui_scroll_manager_efl_ui_scrollbar_bar_visibility_update(Eo *obj, Efl_Ui_Scroll_Manager_Data *sd EINA_UNUSED) 2198_efl_ui_scroll_manager_efl_ui_scrollbar_bar_visibility_update(Eo *obj, Efl_Ui_Scroll_Manager_Data *sd EINA_UNUSED)
2192{ 2199{
2193 _efl_ui_scrollbar_h_visibility_adjust(obj); 2200 _efl_ui_scrollbar_h_visibility_adjust(obj);
diff --git a/src/lib/elementary/efl_ui_scroll_manager.eo b/src/lib/elementary/efl_ui_scroll_manager.eo
index 957a4f4d4d..9dcd9f8a88 100644
--- a/src/lib/elementary/efl_ui_scroll_manager.eo
+++ b/src/lib/elementary/efl_ui_scroll_manager.eo
@@ -39,6 +39,7 @@ class @beta Efl.Ui.Scroll.Manager extends Efl.Object implements
39 Efl.Ui.Scrollbar.bar_mode { get; set; } 39 Efl.Ui.Scrollbar.bar_mode { get; set; }
40 Efl.Ui.Scrollbar.bar_size { get; } 40 Efl.Ui.Scrollbar.bar_size { get; }
41 Efl.Ui.Scrollbar.bar_position { get; set; } 41 Efl.Ui.Scrollbar.bar_position { get; set; }
42 Efl.Ui.Scrollbar.bar_visibility { get; }
42 Efl.Ui.Scrollbar.bar_visibility_update; 43 Efl.Ui.Scrollbar.bar_visibility_update;
43 Efl.Ui.Scrollable.scroll; 44 Efl.Ui.Scrollable.scroll;
44 } 45 }
diff --git a/src/lib/elementary/efl_ui_scroll_util.c b/src/lib/elementary/efl_ui_scroll_util.c
index 673cac2eae..6a7378e3b4 100644
--- a/src/lib/elementary/efl_ui_scroll_util.c
+++ b/src/lib/elementary/efl_ui_scroll_util.c
@@ -38,6 +38,20 @@ _scroll_connector_reload_cb(void *data,
38 const char *source EINA_UNUSED) 38 const char *source EINA_UNUSED)
39{ 39{
40 Scroll_Connector_Context *ctx = data; 40 Scroll_Connector_Context *ctx = data;
41 ELM_WIDGET_DATA_GET_OR_RETURN(ctx->obj, wd);
42 Eina_Bool hbar_visible = EINA_FALSE, vbar_visible = EINA_FALSE;
43
44 efl_ui_scrollbar_bar_visibility_get(ctx->smanager, &hbar_visible, &vbar_visible);
45
46 if (hbar_visible)
47 efl_layout_signal_emit(wd->resize_obj, "efl,horizontal_bar,visible,on", "efl");
48 else
49 efl_layout_signal_emit(wd->resize_obj, "efl,horizontal_bar,visible,off", "efl");
50
51 if (vbar_visible)
52 efl_layout_signal_emit(wd->resize_obj, "efl,vertical_bar,visible,on", "efl");
53 else
54 efl_layout_signal_emit(wd->resize_obj, "efl,vertical_bar,visible,off", "efl");
41 55
42 efl_ui_scrollbar_bar_visibility_update(ctx->smanager); 56 efl_ui_scrollbar_bar_visibility_update(ctx->smanager);
43} 57}