summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/elementary/themes/Makefile.am4
-rw-r--r--data/elementary/themes/default.edc4
-rw-r--r--data/elementary/themes/edc/efl/spin.edc (renamed from data/elementary/themes/edc/elm/spin.edc)18
-rw-r--r--data/elementary/themes/edc/efl/spin_button.edc (renamed from data/elementary/themes/edc/elm/spin_button.edc)182
-rw-r--r--src/bin/elementary/test_part_bg.c3
-rw-r--r--src/lib/elementary/efl_ui_spin.c31
-rw-r--r--src/lib/elementary/efl_ui_spin.eo2
-rw-r--r--src/lib/elementary/efl_ui_spin_button.c63
-rw-r--r--src/lib/elementary/efl_ui_spin_button.eo2
9 files changed, 143 insertions, 166 deletions
diff --git a/data/elementary/themes/Makefile.am b/data/elementary/themes/Makefile.am
index 4bc6ec9987..40ff6973c8 100644
--- a/data/elementary/themes/Makefile.am
+++ b/data/elementary/themes/Makefile.am
@@ -145,8 +145,6 @@ elementary/themes/edc/elm/separator.edc \
145elementary/themes/edc/elm/slider.edc \ 145elementary/themes/edc/elm/slider.edc \
146elementary/themes/edc/elm/slideshow.edc \ 146elementary/themes/edc/elm/slideshow.edc \
147elementary/themes/edc/elm/spinner.edc \ 147elementary/themes/edc/elm/spinner.edc \
148elementary/themes/edc/elm/spin.edc \
149elementary/themes/edc/elm/spin_button.edc \
150elementary/themes/edc/elm/textpath.edc \ 148elementary/themes/edc/elm/textpath.edc \
151elementary/themes/edc/elm/thumb.edc \ 149elementary/themes/edc/elm/thumb.edc \
152elementary/themes/edc/elm/toolbar.edc \ 150elementary/themes/edc/elm/toolbar.edc \
@@ -1033,6 +1031,8 @@ elementary/themes/edc/efl/progress.edc \
1033elementary/themes/edc/efl/radio.edc \ 1031elementary/themes/edc/efl/radio.edc \
1034elementary/themes/edc/efl/scroller.edc \ 1032elementary/themes/edc/efl/scroller.edc \
1035elementary/themes/edc/efl/slider.edc \ 1033elementary/themes/edc/efl/slider.edc \
1034elementary/themes/edc/efl/spin.edc \
1035elementary/themes/edc/efl/spin_button.edc \
1036elementary/themes/edc/efl/text.edc \ 1036elementary/themes/edc/efl/text.edc \
1037elementary/themes/edc/efl/textpath.edc \ 1037elementary/themes/edc/efl/textpath.edc \
1038elementary/themes/edc/efl/tooltip.edc \ 1038elementary/themes/edc/efl/tooltip.edc \
diff --git a/data/elementary/themes/default.edc b/data/elementary/themes/default.edc
index 1bbd492217..119f42eeba 100644
--- a/data/elementary/themes/default.edc
+++ b/data/elementary/themes/default.edc
@@ -66,8 +66,6 @@ collections {
66#include "edc/elm/border.edc" 66#include "edc/elm/border.edc"
67// XXX: min size calc problems - too wide! ... err ok on my 32bit box... eh? 67// XXX: min size calc problems - too wide! ... err ok on my 32bit box... eh?
68#include "edc/elm/spinner.edc" 68#include "edc/elm/spinner.edc"
69#include "edc/elm/spin.edc"
70#include "edc/elm/spin_button.edc"
71#include "edc/elm/menu.edc" 69#include "edc/elm/menu.edc"
72#include "edc/elm/clock.edc" 70#include "edc/elm/clock.edc"
73#include "edc/elm/gengrid.edc" 71#include "edc/elm/gengrid.edc"
@@ -187,6 +185,8 @@ collections {
187#include "edc/efl/photocam.edc" 185#include "edc/efl/photocam.edc"
188#include "edc/efl/progress.edc" 186#include "edc/efl/progress.edc"
189#include "edc/efl/border.edc" 187#include "edc/efl/border.edc"
188#include "edc/efl/spin.edc"
189#include "edc/efl/spin_button.edc"
190// XXX: min size calc problems - too wide! ... err ok on my 32bit box... eh? 190// XXX: min size calc problems - too wide! ... err ok on my 32bit box... eh?
191#include "edc/efl/cursor.edc" 191#include "edc/efl/cursor.edc"
192#include "edc/efl/textpath.edc" 192#include "edc/efl/textpath.edc"
diff --git a/data/elementary/themes/edc/elm/spin.edc b/data/elementary/themes/edc/efl/spin.edc
index 77cf917fd8..a794080dae 100644
--- a/data/elementary/themes/edc/elm/spin.edc
+++ b/data/elementary/themes/edc/efl/spin.edc
@@ -1,17 +1,15 @@
1group { name: "elm/spin/base/default"; 1group { "efl/spin";
2 parts { 2 parts {
3 part { name: "bg"; 3 rect { "bg";
4 type: RECT; 4 scale;
5 scale: 1; 5 desc { "default";
6 description { state: "default" 0.0;
7 color: 0 0 0 0; 6 color: 0 0 0 0;
8 } 7 }
9 } 8 }
10 part { name: "elm.text"; 9 text { "elm.text";
11 type: TEXT; 10 nomouse;
12 mouse_events: 0; 11 scale;
13 scale: 1; 12 desc { "default";
14 description { state: "default" 0.0;
15 color: FN_COL_DEFAULT; 13 color: FN_COL_DEFAULT;
16 text { 14 text {
17 font: FNBD; 15 font: FNBD;
diff --git a/data/elementary/themes/edc/elm/spin_button.edc b/data/elementary/themes/edc/efl/spin_button.edc
index 5b53382691..40e9492a2e 100644
--- a/data/elementary/themes/edc/elm/spin_button.edc
+++ b/data/elementary/themes/edc/efl/spin_button.edc
@@ -1,21 +1,19 @@
1group { name: "elm/spin_button/base/default"; 1group { "efl/spin_button";
2 images.image: "vert_bar_inset.png" COMP; 2 images.image: "vert_bar_inset.png" COMP;
3 parts { 3 parts {
4 part { name: "clip"; type: RECT; 4 rect { "clip";
5 description { state: "default" 0.0; 5 desc { "default";
6 rel1.to: "elm.swallow.text_button"; 6 rel.to: "elm.swallow.text_button";
7 rel2.to: "elm.swallow.text_button";
8 } 7 }
9 } 8 }
10 part { name: "bg"; 9 rect { "bg";
11 type: RECT; 10 scale;
12 scale: 1; 11 desc { "default";
13 description { state: "default" 0.0;
14 color_class: "spinner_bg"; 12 color_class: "spinner_bg";
15 } 13 }
16 } 14 }
17 part { name: "inset"; mouse_events: 0; 15 image { "inset"; nomouse;
18 description { state: "default" 0.0; 16 desc { "default";
19 rel1.offset: 0 1; 17 rel1.offset: 0 1;
20 rel2.offset: -1 -2; 18 rel2.offset: -1 -2;
21 image.normal: "vert_bar_inset.png"; 19 image.normal: "vert_bar_inset.png";
@@ -24,39 +22,36 @@ group { name: "elm/spin_button/base/default";
24 fill.smooth: 0; 22 fill.smooth: 0;
25 } 23 }
26 } 24 }
27 part { name: "access"; 25 rect { "access";
28 type: RECT; 26 repeat;
29 repeat_events: 1; 27 desc { "default";
30 description { state: "default" 0.0;
31 fixed: 1 1; 28 fixed: 1 1;
32 color: 0 0 0 0; 29 color: 0 0 0 0;
33 rel1.to: "inset"; 30 rel1.to: "inset";
34 rel2.to: "inset"; 31 rel2.to: "inset";
35 visible: 0; 32 hid;
36 } 33 }
37 description { state: "active" 0.0; 34 desc { "active";
38 inherit: "default" 0.0; 35 inherit: "default";
39 visible: 1; 36 vis;
40 } 37 }
41 } 38 }
42 part { name: "elm.swallow.entry"; 39 swallow { "elm.swallow.entry";
43 type: SWALLOW; 40 clip: "clip";
44 clip_to: "clip"; 41 desc { "default";
45 description { state: "default" 0.0;
46 fixed: 1 1; 42 fixed: 1 1;
47 rel1.to: "elm.swallow.text_button"; 43 rel1.to: "elm.swallow.text_button";
48 rel2.to: "elm.swallow.text_button"; 44 rel2.to: "elm.swallow.text_button";
49 visible: 0; 45 hid;
50 } 46 }
51 description { state: "active" 0.0; 47 desc { "active";
52 inherit: "default" 0.0; 48 inherit: "default";
53 visible: 1; 49 vis;
54 } 50 }
55 } 51 }
56 part { name: "elm.swallow.dec_button"; 52 swallow { "elm.swallow.dec_button";
57 type: SWALLOW; 53 scale;
58 scale: 1; 54 desc { "default";
59 description { state: "default" 0.0;
60 fixed: 1 0; 55 fixed: 1 0;
61 rel1.to: "inset"; 56 rel1.to: "inset";
62 rel1.offset: 1 1; 57 rel1.offset: 1 1;
@@ -68,10 +63,9 @@ group { name: "elm/spin_button/base/default";
68 aspect: 1.0 1.0; aspect_preference: VERTICAL; 63 aspect: 1.0 1.0; aspect_preference: VERTICAL;
69 } 64 }
70 } 65 }
71 part { name: "elm.swallow.inc_button"; 66 swallow { "elm.swallow.inc_button";
72 type: SWALLOW; 67 scale;
73 scale: 1; 68 desc { "default";
74 description { state: "default" 0.0;
75 fixed: 1 0; 69 fixed: 1 0;
76 rel1.to: "inset"; 70 rel1.to: "inset";
77 rel1.offset: 1 1; 71 rel1.offset: 1 1;
@@ -83,11 +77,10 @@ group { name: "elm/spin_button/base/default";
83 aspect: 1.0 1.0; aspect_preference: VERTICAL; 77 aspect: 1.0 1.0; aspect_preference: VERTICAL;
84 } 78 }
85 } 79 }
86 part { name: "elm.swallow.text_button"; 80 swallow { "elm.swallow.text_button";
87 type: SWALLOW; 81 scale;
88 scale: 1; 82 desc { "default";
89 description { state: "default" 0.0; 83 vis;
90 visible: 1;
91 rel1.to_y: "inset"; 84 rel1.to_y: "inset";
92 rel1.to_x: "elm.swallow.dec_button"; 85 rel1.to_x: "elm.swallow.dec_button";
93 rel1.relative: 1.0 0.0; 86 rel1.relative: 1.0 0.0;
@@ -97,84 +90,82 @@ group { name: "elm/spin_button/base/default";
97 rel2.relative: 0.0 1.0; 90 rel2.relative: 0.0 1.0;
98 rel2.offset: -2 -2; 91 rel2.offset: -2 -2;
99 } 92 }
100 description { state: "inactive" 0.0; 93 desc { "inactive";
101 inherit: "default" 0.0; 94 inherit: "default";
102 visible: 0; 95 hid;
103 } 96 }
104 } 97 }
105 part { name: "disabler"; 98 rect { "disabler";
106 type: RECT; 99 norepeat;
107 repeat_events: 0; 100 nomouse;
108 mouse_events: 0; 101 desc { "default";
109 description { state: "default" 0.0;
110 color: 0 0 0 0; 102 color: 0 0 0 0;
111 visible: 0; 103 hid;
112 } 104 }
113 description { state: "disabled" 0.0; 105 desc { "disabled";
114 inherit: "default" 0.0; 106 inherit: "default";
115 visible: 1; 107 vis;
116 } 108 }
117 } 109 }
118 } 110 }
119 programs { 111 programs {
120 program { name: "entry_active"; 112 program { "entry_active";
121 signal: "elm,state,entry,active"; 113 signal: "elm,state,entry,active";
122 source: "elm"; 114 source: "elm";
123 action: STATE_SET "active" 0.0; 115 action: STATE_SET "active";
124 target: "elm.swallow.entry"; 116 target: "elm.swallow.entry";
125 } 117 }
126 program { name: "entry_inactive"; 118 program { "entry_inactive";
127 signal: "elm,state,entry,inactive"; 119 signal: "elm,state,entry,inactive";
128 source: "elm"; 120 source: "elm";
129 action: STATE_SET "default" 0.0; 121 action: STATE_SET "default";
130 target: "elm.swallow.entry"; 122 target: "elm.swallow.entry";
131 } 123 }
132 program { name: "text_button_active"; 124 program { "text_button_active";
133 signal: "elm,state,button,active"; 125 signal: "elm,state,button,active";
134 source: "elm"; 126 source: "elm";
135 action: STATE_SET "default" 0.0; 127 action: STATE_SET "default";
136 target: "elm.swallow.text_button"; 128 target: "elm.swallow.text_button";
137 } 129 }
138 program { name: "text_button_inactive"; 130 program { "text_button_inactive";
139 signal: "elm,state,button,inactive"; 131 signal: "elm,state,button,inactive";
140 source: "elm"; 132 source: "elm";
141 action: STATE_SET "inactive" 0.0; 133 action: STATE_SET "inactive";
142 target: "elm.swallow.text_button"; 134 target: "elm.swallow.text_button";
143 } 135 }
144 program { name: "access_activate"; 136 program { "access_activate";
145 signal: "elm,state,access,active"; 137 signal: "elm,state,access,active";
146 source: "elm"; 138 source: "elm";
147 action: STATE_SET "active" 0.0; 139 action: STATE_SET "active";
148 target: "access"; 140 target: "access";
149 } 141 }
150 program { name: "access_inactivate"; 142 program { "access_inactivate";
151 signal: "elm,state,access,inactive"; 143 signal: "elm,state,access,inactive";
152 source: "elm"; 144 source: "elm";
153 action: STATE_SET "default" 0.0; 145 action: STATE_SET "default";
154 target: "access"; 146 target: "access";
155 } 147 }
156 program { name: "disable"; 148 program { "disable";
157 signal: "elm,state,disabled"; 149 signal: "elm,state,disabled";
158 source: "elm"; 150 source: "elm";
159 action: STATE_SET "disabled" 0.0; 151 action: STATE_SET "disabled";
160 target: "disabler"; 152 target: "disabler";
161 } 153 }
162 program { name: "enable"; 154 program { "enable";
163 signal: "elm,state,enabled"; 155 signal: "elm,state,enabled";
164 source: "elm"; 156 source: "elm";
165 action: STATE_SET "default" 0.0; 157 action: STATE_SET "default";
166 target: "disabler"; 158 target: "disabler";
167 } 159 }
168 } 160 }
169} 161}
170 162
171group { name: "elm/spin_button/base/vertical"; 163group { "efl/spin_button:vertical";
172 inherit: "elm/spin_button/base/default"; 164 inherit: "efl/spin_button";
173 parts { 165 parts {
174 part { name: "elm.swallow.inc_button"; 166 swallow { "elm.swallow.inc_button";
175 type: SWALLOW; 167 scale;
176 scale: 1; 168 desc { "default";
177 description { state: "default" 0.0;
178 rel1.to: "inset"; 169 rel1.to: "inset";
179 rel1.offset: 1 1; 170 rel1.offset: 1 1;
180 rel1.relative: 1.0 0.0; 171 rel1.relative: 1.0 0.0;
@@ -183,11 +174,10 @@ group { name: "elm/spin_button/base/vertical";
183 align: 1.0 0.5; 174 align: 1.0 0.5;
184 } 175 }
185 } 176 }
186 part { name: "elm.swallow.text_button"; 177 swallow { "elm.swallow.text_button";
187 type: SWALLOW; 178 scale;
188 scale: 1; 179 desc { "default";
189 description { state: "default" 0.0; 180 vis;
190 visible: 1;
191 rel1.to_y: "inset"; 181 rel1.to_y: "inset";
192 rel1.to_x: "elm.swallow.dec_button"; 182 rel1.to_x: "elm.swallow.dec_button";
193 rel1.relative: 1.0 0.0; 183 rel1.relative: 1.0 0.0;
@@ -197,15 +187,14 @@ group { name: "elm/spin_button/base/vertical";
197 rel2.relative: 0.0 1.0; 187 rel2.relative: 0.0 1.0;
198 rel2.offset: -2 -2; 188 rel2.offset: -2 -2;
199 } 189 }
200 description { state: "active" 0.0; 190 desc { "active";
201 inherit: "default" 0.0; 191 inherit: "default";
202 visible: 0; 192 hid;
203 } 193 }
204 } 194 }
205 part { name: "elm.swallow.dec_button"; 195 swallow { "elm.swallow.dec_button";
206 type: SWALLOW; 196 scale;
207 scale: 1; 197 desc { "default";
208 description { state: "default" 0.0;
209 rel1.to: "inset"; 198 rel1.to: "inset";
210 rel1.offset: 1 1; 199 rel1.offset: 1 1;
211 rel2.to: "inset"; 200 rel2.to: "inset";
@@ -216,3 +205,24 @@ group { name: "elm/spin_button/base/vertical";
216 } 205 }
217 } 206 }
218} 207}
208
209group { "efl/spin_button/inc_button";
210 inherit: "elm/button/base/spinner/increase/default";
211}
212
213group { "efl/spin_button/dec_button";
214 inherit: "elm/button/base/spinner/decrease/default";
215}
216
217group { "efl/spin_button/text_button";
218 inherit: "elm/button/base/spinner/default";
219 alias: "efl/spin_button/text_button:vertical";
220}
221
222group { "efl/spin_button/inc_button:vertical";
223 inherit: "elm/button/base/spinner/increase/vertical";
224}
225
226group { "efl/spin_button/dec_button:vertical";
227 inherit: "elm/button/base/spinner/decrease/vertical";
228} \ No newline at end of file
diff --git a/src/bin/elementary/test_part_bg.c b/src/bin/elementary/test_part_bg.c
index 26ba4dc7eb..c3b391b673 100644
--- a/src/bin/elementary/test_part_bg.c
+++ b/src/bin/elementary/test_part_bg.c
@@ -3,7 +3,7 @@
3#endif 3#endif
4#include <Elementary.h> 4#include <Elementary.h>
5 5
6#define MAX_NUM_OF_CONTENT 18 6#define MAX_NUM_OF_CONTENT 19
7 7
8const Efl_Class *content_class[MAX_NUM_OF_CONTENT]; 8const Efl_Class *content_class[MAX_NUM_OF_CONTENT];
9 9
@@ -141,6 +141,7 @@ test_part_background(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
141 content_class[15] = EFL_UI_IMAGE_ZOOMABLE_CLASS; 141 content_class[15] = EFL_UI_IMAGE_ZOOMABLE_CLASS;
142 content_class[16] = EFL_UI_NSTATE_CLASS; 142 content_class[16] = EFL_UI_NSTATE_CLASS;
143 content_class[17] = EFL_UI_SPIN_CLASS; 143 content_class[17] = EFL_UI_SPIN_CLASS;
144 content_class[18] = EFL_UI_SPIN_BUTTON_CLASS;
144 145
145 win = efl_add(EFL_UI_WIN_CLASS, NULL, 146 win = efl_add(EFL_UI_WIN_CLASS, NULL,
146 efl_text_set(efl_added, "Widget Part Background"), 147 efl_text_set(efl_added, "Widget Part Background"),
diff --git a/src/lib/elementary/efl_ui_spin.c b/src/lib/elementary/efl_ui_spin.c
index dadb404041..d24d20d309 100644
--- a/src/lib/elementary/efl_ui_spin.c
+++ b/src/lib/elementary/efl_ui_spin.c
@@ -150,19 +150,6 @@ _efl_ui_spin_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Spin_Data *_pd EINA_UNUSED)
150 evas_object_size_hint_max_set(obj, -1, -1); 150 evas_object_size_hint_max_set(obj, -1, -1);
151} 151}
152 152
153EOLIAN static Efl_Ui_Theme_Apply
154_efl_ui_spin_elm_widget_theme_apply(Eo *obj, Efl_Ui_Spin_Data *sd EINA_UNUSED)
155{
156 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED);
157
158 if (!elm_layout_theme_set(obj, "spin", "base", elm_widget_style_get(obj)))
159 CRI("Failed to set layout!");
160
161 elm_layout_sizing_eval(obj);
162
163 return EFL_UI_THEME_APPLY_SUCCESS;
164}
165
166EOLIAN static Eina_Bool 153EOLIAN static Eina_Bool
167_efl_ui_spin_elm_widget_widget_event(Eo *obj, Efl_Ui_Spin_Data *sd, const Efl_Event *eo_event, Evas_Object *src EINA_UNUSED) 154_efl_ui_spin_elm_widget_widget_event(Eo *obj, Efl_Ui_Spin_Data *sd, const Efl_Event *eo_event, Evas_Object *src EINA_UNUSED)
168{ 155{
@@ -187,6 +174,10 @@ _efl_ui_spin_elm_widget_widget_event(Eo *obj, Efl_Ui_Spin_Data *sd, const Efl_Ev
187EOLIAN static Eo * 174EOLIAN static Eo *
188_efl_ui_spin_efl_object_constructor(Eo *obj, Efl_Ui_Spin_Data *sd) 175_efl_ui_spin_efl_object_constructor(Eo *obj, Efl_Ui_Spin_Data *sd)
189{ 176{
177 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
178
179 if (!elm_widget_theme_klass_get(obj))
180 elm_widget_theme_klass_set(obj, "spin");
190 obj = efl_constructor(efl_super(obj, MY_CLASS)); 181 obj = efl_constructor(efl_super(obj, MY_CLASS));
191 182
192 elm_widget_sub_object_parent_add(obj); 183 elm_widget_sub_object_parent_add(obj);
@@ -194,8 +185,10 @@ _efl_ui_spin_efl_object_constructor(Eo *obj, Efl_Ui_Spin_Data *sd)
194 sd->val_max = 100.0; 185 sd->val_max = 100.0;
195 sd->step = 1.0; 186 sd->step = 1.0;
196 187
197 if (!elm_layout_theme_set(obj, "spin", "base", 188 if (!elm_widget_theme_object_set(obj, wd->resize_obj,
198 elm_widget_style_get(obj))) 189 elm_widget_theme_klass_get(obj),
190 elm_widget_theme_element_get(obj),
191 elm_widget_theme_style_get(obj)))
199 CRI("Failed to set layout!"); 192 CRI("Failed to set layout!");
200 193
201 _label_write(obj); 194 _label_write(obj);
@@ -206,14 +199,6 @@ _efl_ui_spin_efl_object_constructor(Eo *obj, Efl_Ui_Spin_Data *sd)
206 return obj; 199 return obj;
207} 200}
208 201
209EOLIAN static Eo *
210_efl_ui_spin_efl_object_finalize(Eo *obj, Efl_Ui_Spin_Data *sd EINA_UNUSED)
211{
212 obj = efl_finalize(efl_super(obj, MY_CLASS));
213
214 return obj;
215}
216
217EOLIAN static void 202EOLIAN static void
218_efl_ui_spin_efl_object_destructor(Eo *obj, Efl_Ui_Spin_Data *sd EINA_UNUSED) 203_efl_ui_spin_efl_object_destructor(Eo *obj, Efl_Ui_Spin_Data *sd EINA_UNUSED)
219{ 204{
diff --git a/src/lib/elementary/efl_ui_spin.eo b/src/lib/elementary/efl_ui_spin.eo
index fae80d1e40..f350cb1413 100644
--- a/src/lib/elementary/efl_ui_spin.eo
+++ b/src/lib/elementary/efl_ui_spin.eo
@@ -10,9 +10,7 @@ class Efl.Ui.Spin (Efl.Ui.Layout, Efl.Ui.Range, Efl.Ui.Format,
10 ]] 10 ]]
11 implements { 11 implements {
12 Efl.Object.constructor; 12 Efl.Object.constructor;
13 Efl.Object.finalize;
14 Efl.Object.destructor; 13 Efl.Object.destructor;
15 Elm.Widget.theme_apply;
16 Elm.Widget.widget_event; 14 Elm.Widget.widget_event;
17 Efl.Ui.Range.range_min_max { get; set; } 15 Efl.Ui.Range.range_min_max { get; set; }
18 Efl.Ui.Range.range_step { get; set; } 16 Efl.Ui.Range.range_step { get; set; }
diff --git a/src/lib/elementary/efl_ui_spin_button.c b/src/lib/elementary/efl_ui_spin_button.c
index eaf47435d1..abc49eda93 100644
--- a/src/lib/elementary/efl_ui_spin_button.c
+++ b/src/lib/elementary/efl_ui_spin_button.c
@@ -20,6 +20,10 @@
20 20
21#define EFL_UI_SPIN_BUTTON_DELAY_CHANGE_TIME 0.2 21#define EFL_UI_SPIN_BUTTON_DELAY_CHANGE_TIME 0.2
22 22
23static const char PART_NAME_DEC_BUTTON[] = "dec_button";
24static const char PART_NAME_TEXT_BUTTON[] = "text_button";
25static const char PART_NAME_INC_BUTTON[] = "inc_button";
26
23static void 27static void
24_inc_dec_button_clicked_cb(void *data, const Efl_Event *event); 28_inc_dec_button_clicked_cb(void *data, const Efl_Event *event);
25static void 29static void
@@ -101,13 +105,15 @@ _label_write(Evas_Object *obj)
101 Efl_Ui_Spin_Data *pd = efl_data_scope_get(obj, EFL_UI_SPIN_CLASS); 105 Efl_Ui_Spin_Data *pd = efl_data_scope_get(obj, EFL_UI_SPIN_CLASS);
102 106
103 if (pd->templates) 107 if (pd->templates)
104 elm_layout_text_set(sd->text_button, "elm.text", pd->templates); 108 {
109 efl_text_set(sd->text_button, pd->templates);
110 }
105 else 111 else
106 { 112 {
107 char buf[1024]; 113 char buf[1024];
108 114
109 snprintf(buf, sizeof(buf), "%.0f", pd->val); 115 snprintf(buf, sizeof(buf), "%.0f", pd->val);
110 elm_layout_text_set(sd->text_button, "elm.text", buf); 116 efl_text_set(sd->text_button, buf);
111 } 117 }
112} 118}
113 119
@@ -151,9 +157,7 @@ _entry_hide(Evas_Object *obj)
151 Efl_Ui_Spin_Button_Data *sd = efl_data_scope_get(obj, MY_CLASS); 157 Efl_Ui_Spin_Button_Data *sd = efl_data_scope_get(obj, MY_CLASS);
152 158
153 elm_layout_signal_emit(obj, "elm,state,button,active", "elm"); 159 elm_layout_signal_emit(obj, "elm,state,button,active", "elm");
154 evas_object_show(sd->text_button);
155 elm_layout_signal_emit(obj, "elm,state,entry,inactive", "elm"); 160 elm_layout_signal_emit(obj, "elm,state,entry,inactive", "elm");
156 evas_object_hide(sd->ent);
157 161
158 if (sd->entry_visible && !evas_focus_state_get(evas_object_evas_get(obj))) 162 if (sd->entry_visible && !evas_focus_state_get(evas_object_evas_get(obj)))
159 sd->entry_reactivate = EINA_TRUE; 163 sd->entry_reactivate = EINA_TRUE;
@@ -337,7 +341,6 @@ _entry_show_cb(void *data,
337 elm_entry_select_all(obj); 341 elm_entry_select_all(obj);
338 sd->entry_visible = EINA_TRUE; 342 sd->entry_visible = EINA_TRUE;
339 elm_layout_signal_emit(data, "elm,state,button,inactive", "elm"); 343 elm_layout_signal_emit(data, "elm,state,button,inactive", "elm");
340 evas_object_hide(sd->text_button);
341} 344}
342 345
343static void 346static void
@@ -376,7 +379,6 @@ _toggle_entry(Evas_Object *obj)
376 _entry_focus_changed_cb, obj); 379 _entry_focus_changed_cb, obj);
377 sd->entry_visible = EINA_TRUE; 380 sd->entry_visible = EINA_TRUE;
378 elm_layout_signal_emit(obj, "elm,state,entry,active", "elm"); 381 elm_layout_signal_emit(obj, "elm,state,entry,active", "elm");
379 evas_object_show(sd->ent);
380 { 382 {
381 Eina_List *items = NULL; 383 Eina_List *items = NULL;
382 384
@@ -617,7 +619,7 @@ _access_info_cb(void *data, Evas_Object *obj EINA_UNUSED)
617 if (sd->entry_visible) 619 if (sd->entry_visible)
618 txt = elm_object_text_get(sd->ent); 620 txt = elm_object_text_get(sd->ent);
619 else 621 else
620 txt = elm_object_text_get(sd->text_button); 622 txt = efl_text_get(sd->text_button);
621 623
622 if (txt) return strdup(txt); 624 if (txt) return strdup(txt);
623 625
@@ -717,13 +719,14 @@ _access_spinner_register(Evas_Object *obj, Eina_Bool is_access)
717EOLIAN static Efl_Ui_Theme_Apply 719EOLIAN static Efl_Ui_Theme_Apply
718_efl_ui_spin_button_elm_widget_theme_apply(Eo *obj, Efl_Ui_Spin_Button_Data *sd EINA_UNUSED) 720_efl_ui_spin_button_elm_widget_theme_apply(Eo *obj, Efl_Ui_Spin_Button_Data *sd EINA_UNUSED)
719{ 721{
720 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED); 722 Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
721 723
722 if (!elm_layout_theme_set(obj, "spin_button", "base", elm_widget_style_get(obj))) 724 int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
723 CRI("Failed to set layout!"); 725 if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
724 726
725 if (sd->ent) 727 if (sd->ent)
726 { 728 {
729 //elm_widget_element_update(obj, sd->ent, PART_NAME_TEXT);
727 Eina_Strbuf *buf = eina_strbuf_new(); 730 Eina_Strbuf *buf = eina_strbuf_new();
728 eina_strbuf_append_printf(buf, "spin_button/%s", elm_widget_style_get(obj)); 731 eina_strbuf_append_printf(buf, "spin_button/%s", elm_widget_style_get(obj));
729 elm_widget_style_set(sd->ent, eina_strbuf_string_get(buf)); 732 elm_widget_style_set(sd->ent, eina_strbuf_string_get(buf));
@@ -731,56 +734,40 @@ _efl_ui_spin_button_elm_widget_theme_apply(Eo *obj, Efl_Ui_Spin_Button_Data *sd
731 } 734 }
732 735
733 if (sd->inc_button) 736 if (sd->inc_button)
734 { 737 elm_widget_element_update(obj, sd->inc_button, PART_NAME_INC_BUTTON);
735 Eina_Strbuf *buf = eina_strbuf_new();
736 eina_strbuf_append_printf(buf, "spin_button/increase/%s", elm_widget_style_get(obj));
737 elm_widget_style_set(sd->inc_button, eina_strbuf_string_get(buf));
738 eina_strbuf_free(buf);
739 }
740 738
741 if (sd->text_button) 739 if (sd->text_button)
742 { 740 elm_widget_element_update(obj, sd->text_button, PART_NAME_TEXT_BUTTON);
743 Eina_Strbuf *buf = eina_strbuf_new();
744 eina_strbuf_append_printf(buf, "spin_button/%s", elm_widget_style_get(obj));
745 elm_widget_style_set(sd->text_button, eina_strbuf_string_get(buf));
746 eina_strbuf_free(buf);
747 }
748 741
749 if (sd->dec_button) 742 if (sd->dec_button)
750 { 743 elm_widget_element_update(obj, sd->dec_button, PART_NAME_DEC_BUTTON);
751 Eina_Strbuf *buf = eina_strbuf_new();
752 eina_strbuf_append_printf(buf, "spin_button/decrease/%s", elm_widget_style_get(obj));
753 elm_widget_style_set(sd->dec_button, eina_strbuf_string_get(buf));
754 eina_strbuf_free(buf);
755 }
756 744
757 if (_elm_config->access_mode) 745 if (_elm_config->access_mode)
758 _access_spinner_register(obj, EINA_TRUE); 746 _access_spinner_register(obj, EINA_TRUE);
759 747
748 _label_write(obj);
760 elm_layout_sizing_eval(obj); 749 elm_layout_sizing_eval(obj);
761 return EFL_UI_THEME_APPLY_SUCCESS; 750 return EFL_UI_THEME_APPLY_SUCCESS;
762} 751}
763 752
764EOLIAN static Eo * 753EOLIAN static Eo *
765_efl_ui_spin_button_efl_object_finalize(Eo *obj, Efl_Ui_Spin_Button_Data *sd) 754_efl_ui_spin_button_efl_object_constructor(Eo *obj, Efl_Ui_Spin_Button_Data *sd)
766{ 755{
767 obj = efl_finalize(efl_super(obj, MY_CLASS)); 756 if (!elm_widget_theme_klass_get(obj))
757 elm_widget_theme_klass_set(obj, "spin_button");
758 obj = efl_constructor(efl_super(obj, MY_CLASS));
768 759
769 elm_widget_sub_object_parent_add(obj); 760 elm_widget_sub_object_parent_add(obj);
770 761
771 sd->first_interval = 0.85; 762 sd->first_interval = 0.85;
772 763
773 if (!elm_layout_theme_set(obj, "spin_button", "base",
774 elm_widget_style_get(obj)))
775 CRI("Failed to set layout!");
776
777 sd->inc_button = efl_add(EFL_UI_BUTTON_CLASS, obj, 764 sd->inc_button = efl_add(EFL_UI_BUTTON_CLASS, obj,
778 efl_ui_widget_style_set(efl_added, "spinner/increase/default"), 765 elm_widget_element_update(obj, efl_added, PART_NAME_INC_BUTTON),
779 efl_event_callback_array_add(efl_added, _inc_dec_button_cb(), obj), 766 efl_event_callback_array_add(efl_added, _inc_dec_button_cb(), obj),
780 efl_content_set(efl_part(obj, "elm.swallow.inc_button"), efl_added)); 767 efl_content_set(efl_part(obj, "elm.swallow.inc_button"), efl_added));
781 768
782 sd->text_button = efl_add(EFL_UI_BUTTON_CLASS, obj, 769 sd->text_button = efl_add(EFL_UI_BUTTON_CLASS, obj,
783 efl_ui_widget_style_set(efl_added, "spinner/default"), 770 elm_widget_element_update(obj, efl_added, PART_NAME_TEXT_BUTTON),
784 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, 771 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
785 _text_button_clicked_cb, obj), 772 _text_button_clicked_cb, obj),
786 efl_event_callback_add(efl_added, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED, 773 efl_event_callback_add(efl_added, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED,
@@ -788,7 +775,7 @@ _efl_ui_spin_button_efl_object_finalize(Eo *obj, Efl_Ui_Spin_Button_Data *sd)
788 efl_content_set(efl_part(obj, "elm.swallow.text_button"), efl_added)); 775 efl_content_set(efl_part(obj, "elm.swallow.text_button"), efl_added));
789 776
790 sd->dec_button = efl_add(EFL_UI_BUTTON_CLASS, obj, 777 sd->dec_button = efl_add(EFL_UI_BUTTON_CLASS, obj,
791 efl_ui_widget_style_set(efl_added, "spinner/decrease/default"), 778 elm_widget_element_update(obj, efl_added, PART_NAME_DEC_BUTTON),
792 efl_event_callback_array_add(efl_added, _inc_dec_button_cb(), obj), 779 efl_event_callback_array_add(efl_added, _inc_dec_button_cb(), obj),
793 efl_content_set(efl_part(obj, "elm.swallow.dec_button"), efl_added)); 780 efl_content_set(efl_part(obj, "elm.swallow.dec_button"), efl_added));
794 781
@@ -805,10 +792,8 @@ _efl_ui_spin_button_efl_object_finalize(Eo *obj, Efl_Ui_Spin_Button_Data *sd)
805 elm_layout_signal_callback_add 792 elm_layout_signal_callback_add
806 (obj, "elm,action,entry,toggle", "*", _entry_toggle_cb, NULL); 793 (obj, "elm,action,entry,toggle", "*", _entry_toggle_cb, NULL);
807 794
808 _label_write(obj);
809 elm_widget_can_focus_set(obj, EINA_TRUE); 795 elm_widget_can_focus_set(obj, EINA_TRUE);
810 796
811 elm_layout_sizing_eval(obj);
812 efl_access_role_set(obj, EFL_ACCESS_ROLE_SPIN_BUTTON); 797 efl_access_role_set(obj, EFL_ACCESS_ROLE_SPIN_BUTTON);
813 798
814 return obj; 799 return obj;
diff --git a/src/lib/elementary/efl_ui_spin_button.eo b/src/lib/elementary/efl_ui_spin_button.eo
index 06c604e574..e12841d838 100644
--- a/src/lib/elementary/efl_ui_spin_button.eo
+++ b/src/lib/elementary/efl_ui_spin_button.eo
@@ -63,7 +63,7 @@ class Efl.Ui.Spin_Button (Efl.Ui.Spin, Efl.Ui.Focus.Composition,
63 } 63 }
64 } 64 }
65 implements { 65 implements {
66 Efl.Object.finalize; 66 Efl.Object.constructor;
67 Elm.Widget.theme_apply; 67 Elm.Widget.theme_apply;
68 Elm.Widget.widget_event; 68 Elm.Widget.widget_event;
69 Elm.Widget.on_focus_update; 69 Elm.Widget.on_focus_update;