summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elm_separator.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/elementary/elm_separator.c')
-rw-r--r--src/lib/elementary/elm_separator.c47
1 files changed, 8 insertions, 39 deletions
diff --git a/src/lib/elementary/elm_separator.c b/src/lib/elementary/elm_separator.c
index e9d3952c99..bb0e8f59ba 100644
--- a/src/lib/elementary/elm_separator.c
+++ b/src/lib/elementary/elm_separator.c
@@ -22,7 +22,7 @@ _elm_separator_elm_widget_theme_apply(Eo *obj, Elm_Separator_Data *sd EINA_UNUSE
22 Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED; 22 Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
23 EFL_UI_LAYOUT_DATA_GET(obj, ld); 23 EFL_UI_LAYOUT_DATA_GET(obj, ld);
24 24
25 if (sd->orientation == EFL_ORIENT_HORIZONTAL) 25 if (sd->horizontal)
26 eina_stringshare_replace(&ld->group, "horizontal"); 26 eina_stringshare_replace(&ld->group, "horizontal");
27 else 27 else
28 eina_stringshare_replace(&ld->group, "vertical"); 28 eina_stringshare_replace(&ld->group, "vertical");
@@ -52,8 +52,6 @@ _elm_separator_efl_canvas_group_group_add(Eo *obj, Elm_Separator_Data *sd EINA_U
52 elm_widget_sub_object_parent_add(obj); 52 elm_widget_sub_object_parent_add(obj);
53 elm_widget_can_focus_set(obj, EINA_FALSE); 53 elm_widget_can_focus_set(obj, EINA_FALSE);
54 54
55 sd->orientation = EFL_ORIENT_VERTICAL;
56
57 if (!elm_layout_theme_set 55 if (!elm_layout_theme_set
58 (obj, "separator", "vertical", elm_widget_style_get(obj))) 56 (obj, "separator", "vertical", elm_widget_style_get(obj)))
59 CRI("Failed to set layout!"); 57 CRI("Failed to set layout!");
@@ -68,32 +66,6 @@ elm_separator_add(Evas_Object *parent)
68 return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added)); 66 return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
69} 67}
70 68
71EAPI void
72elm_separator_horizontal_set(Evas_Object *obj, Eina_Bool horizontal)
73{
74 Efl_Orient orient;
75
76 if (horizontal)
77 orient = EFL_ORIENT_HORIZONTAL;
78 else
79 orient = EFL_ORIENT_VERTICAL;
80
81 if (orient == efl_orientation_get(obj)) return;
82
83 efl_orientation_set(obj, orient);
84}
85
86EAPI Eina_Bool
87elm_separator_horizontal_get(const Evas_Object *obj)
88{
89 ELM_SEPARATOR_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
90
91 if (sd->orientation == EFL_ORIENT_VERTICAL)
92 return EINA_FALSE;
93 else
94 return EINA_TRUE;
95}
96
97EOLIAN static Eo * 69EOLIAN static Eo *
98_elm_separator_efl_object_constructor(Eo *obj, Elm_Separator_Data *sd EINA_UNUSED) 70_elm_separator_efl_object_constructor(Eo *obj, Elm_Separator_Data *sd EINA_UNUSED)
99{ 71{
@@ -105,23 +77,20 @@ _elm_separator_efl_object_constructor(Eo *obj, Elm_Separator_Data *sd EINA_UNUSE
105} 77}
106 78
107EOLIAN static void 79EOLIAN static void
108_elm_separator_efl_orientation_orientation_set(Eo *obj, Elm_Separator_Data *sd, Efl_Orient dir) 80_elm_separator_horizontal_set(Eo *obj, Elm_Separator_Data *sd, Eina_Bool horizontal)
109{ 81{
110 if (dir != EFL_ORIENT_VERTICAL && 82 horizontal = !!horizontal;
111 dir != EFL_ORIENT_HORIZONTAL) 83 if (sd->horizontal == horizontal) return;
112 return;
113
114 if (sd->orientation == dir) return;
115 84
116 sd->orientation = dir; 85 sd->horizontal = horizontal;
117 86
118 elm_obj_widget_theme_apply(obj); 87 elm_obj_widget_theme_apply(obj);
119} 88}
120 89
121EOLIAN static Efl_Orient 90EOLIAN static Eina_Bool
122_elm_separator_efl_orientation_orientation_get(Eo *obj EINA_UNUSED, Elm_Separator_Data *sd) 91_elm_separator_horizontal_get(Eo *obj EINA_UNUSED, Elm_Separator_Data *sd)
123{ 92{
124 return sd->orientation; 93 return sd->horizontal;
125} 94}
126 95
127EOLIAN static Eina_Bool 96EOLIAN static Eina_Bool