summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaehyun Cho <jae_hyun.cho@samsung.com>2017-11-27 15:31:37 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2017-11-28 17:15:42 +0900
commitdcb7093c4c6681680bb3a78cc611c8443ac101d9 (patch)
treef7fdba915e6ff4f34d49048303865916800fa3d9 /src
parent59788cc9d072d3ff7c2f6ea42df18648c9c678d8 (diff)
efl_ui_popup_alert: Remove expandable property for now
It needs more time to stabilize expandable property. So the expandable property is removed for now. The expandable property will be added later.
Diffstat (limited to 'src')
-rw-r--r--src/bin/elementary/test_ui_popup.c6
-rw-r--r--src/lib/elementary/efl_ui_popup_alert_scroll.c97
-rw-r--r--src/lib/elementary/efl_ui_popup_alert_scroll.eo17
-rw-r--r--src/lib/elementary/efl_ui_popup_alert_scroll_private.h8
-rw-r--r--src/lib/elementary/efl_ui_popup_alert_text.c44
-rw-r--r--src/lib/elementary/efl_ui_popup_alert_text.eo16
-rw-r--r--src/lib/elementary/efl_ui_popup_alert_text_private.h6
7 files changed, 6 insertions, 188 deletions
diff --git a/src/bin/elementary/test_ui_popup.c b/src/bin/elementary/test_ui_popup.c
index 770ff93f7c..3db83fb123 100644
--- a/src/bin/elementary/test_ui_popup.c
+++ b/src/bin/elementary/test_ui_popup.c
@@ -383,9 +383,6 @@ test_ui_popup_alert_scroll(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
383 efl_ui_popup_alert_button_set(efl_ui_popup, EFL_UI_POPUP_ALERT_BUTTON_NEGATIVE, "No"); 383 efl_ui_popup_alert_button_set(efl_ui_popup, EFL_UI_POPUP_ALERT_BUTTON_NEGATIVE, "No");
384 efl_ui_popup_alert_button_set(efl_ui_popup, EFL_UI_POPUP_ALERT_BUTTON_USER, "Cancel"); 384 efl_ui_popup_alert_button_set(efl_ui_popup, EFL_UI_POPUP_ALERT_BUTTON_USER, "Cancel");
385 385
386 efl_ui_popup_alert_scroll_expandable_set(efl_ui_popup, EINA_TRUE, EINA_TRUE);
387 efl_gfx_size_hint_max_set(efl_ui_popup, EINA_SIZE2D(300, 180));
388
389 efl_event_callback_add(efl_ui_popup, EFL_UI_POPUP_ALERT_EVENT_CLICKED, efl_ui_popup_alert_clicked_cb, NULL); 386 efl_event_callback_add(efl_ui_popup, EFL_UI_POPUP_ALERT_EVENT_CLICKED, efl_ui_popup_alert_clicked_cb, NULL);
390} 387}
391 388
@@ -413,9 +410,6 @@ test_ui_popup_alert_text(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, v
413 efl_ui_popup_alert_button_set(efl_ui_popup, EFL_UI_POPUP_ALERT_BUTTON_NEGATIVE, "No"); 410 efl_ui_popup_alert_button_set(efl_ui_popup, EFL_UI_POPUP_ALERT_BUTTON_NEGATIVE, "No");
414 efl_ui_popup_alert_button_set(efl_ui_popup, EFL_UI_POPUP_ALERT_BUTTON_USER, "Cancel"); 411 efl_ui_popup_alert_button_set(efl_ui_popup, EFL_UI_POPUP_ALERT_BUTTON_USER, "Cancel");
415 412
416 efl_ui_popup_alert_text_expandable_set(efl_ui_popup, EINA_TRUE);
417 efl_gfx_size_hint_max_set(efl_ui_popup, EINA_SIZE2D(100, 180));
418
419 efl_event_callback_add(efl_ui_popup, EFL_UI_POPUP_ALERT_EVENT_CLICKED, efl_ui_popup_alert_clicked_cb, NULL); 413 efl_event_callback_add(efl_ui_popup, EFL_UI_POPUP_ALERT_EVENT_CLICKED, efl_ui_popup_alert_clicked_cb, NULL);
420} 414}
421 415
diff --git a/src/lib/elementary/efl_ui_popup_alert_scroll.c b/src/lib/elementary/efl_ui_popup_alert_scroll.c
index ac57b3d6b4..ed790db052 100644
--- a/src/lib/elementary/efl_ui_popup_alert_scroll.c
+++ b/src/lib/elementary/efl_ui_popup_alert_scroll.c
@@ -12,63 +12,9 @@
12#define MY_CLASS EFL_UI_POPUP_ALERT_SCROLL_CLASS 12#define MY_CLASS EFL_UI_POPUP_ALERT_SCROLL_CLASS
13#define MY_CLASS_NAME "Efl.Ui.Popup.Alert.Scroll" 13#define MY_CLASS_NAME "Efl.Ui.Popup.Alert.Scroll"
14 14
15static void
16_scroller_sizing_eval(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *pd, Eina_Size2D min)
17{
18 Eina_Rect geom = efl_gfx_geometry_get(obj);
19
20 pd->is_sizing_eval = EINA_TRUE;
21
22 if (pd->is_expandable_w && !pd->is_expandable_h)
23 {
24 if ((pd->max_scroll.w > -1) && (min.w > pd->max_scroll.w))
25 {
26 elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE);
27 efl_gfx_size_set(obj, EINA_SIZE2D(pd->max_scroll.w, geom.h));
28 }
29 }
30 else if (!pd->is_expandable_w && pd->is_expandable_h)
31 {
32 if ((pd->max_scroll.h > -1) && (min.h > pd->max_scroll.h))
33 {
34 elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE);
35 efl_gfx_size_set(obj, EINA_SIZE2D(geom.w, pd->max_scroll.h));
36 }
37 }
38 else if (pd->is_expandable_w && pd->is_expandable_h)
39 {
40 Eina_Bool wdir, hdir;
41 wdir = hdir = EINA_FALSE;
42
43 if ((pd->max_scroll.w > -1) && (min.w > pd->max_scroll.w))
44 wdir = 1;
45 if ((pd->max_scroll.h > -1) && (min.h > pd->max_scroll.h))
46 hdir = 1;
47 if (wdir && !hdir)
48 {
49 elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_TRUE);
50 efl_gfx_size_set(obj, EINA_SIZE2D(pd->max_scroll.w, geom.h));
51 }
52 else if (!wdir && hdir)
53 {
54 elm_scroller_content_min_limit(pd->scroller, EINA_TRUE, EINA_FALSE);
55 efl_gfx_size_set(obj, EINA_SIZE2D(geom.w, pd->max_scroll.h));
56 }
57 else if(wdir && hdir)
58 {
59 elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE);
60 efl_gfx_size_set(obj, pd->max_scroll);
61 }
62 }
63
64 pd->is_sizing_eval = EINA_FALSE;
65}
66
67EOLIAN static void 15EOLIAN static void
68_efl_ui_popup_alert_scroll_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *pd) 16_efl_ui_popup_alert_scroll_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *pd EINA_UNUSED)
69{ 17{
70 if (pd->is_sizing_eval) return;
71
72 elm_layout_sizing_eval(efl_super(obj, MY_CLASS)); 18 elm_layout_sizing_eval(efl_super(obj, MY_CLASS));
73 19
74 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); 20 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
@@ -78,8 +24,6 @@ _efl_ui_popup_alert_scroll_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Popup_Alert_Sc
78 edje_object_size_min_restricted_calc 24 edje_object_size_min_restricted_calc
79 (wd->resize_obj, &minw, &minh, minw, minh); 25 (wd->resize_obj, &minw, &minh, minw, minh);
80 efl_gfx_size_hint_min_set(obj, EINA_SIZE2D(minw, minh)); 26 efl_gfx_size_hint_min_set(obj, EINA_SIZE2D(minw, minh));
81
82 _scroller_sizing_eval(obj, pd, EINA_SIZE2D(minw, minh));
83} 27}
84 28
85static Eina_Bool 29static Eina_Bool
@@ -145,43 +89,6 @@ _efl_ui_popup_alert_scroll_text_get(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Alert_Scro
145 return efl_text_get(efl_part(efl_super(obj, MY_CLASS), part)); 89 return efl_text_get(efl_part(efl_super(obj, MY_CLASS), part));
146} 90}
147 91
148static void
149_efl_ui_popup_alert_scroll_expandable_set(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Alert_Scroll_Data *pd, Eina_Bool is_expandable_w, Eina_Bool is_expandable_h)
150{
151 if (is_expandable_w && !is_expandable_h)
152 {
153 pd->is_expandable_w = EINA_TRUE;
154 pd->is_expandable_h = EINA_FALSE;
155 elm_scroller_content_min_limit(pd->scroller, EINA_TRUE, EINA_FALSE);
156 }
157 else if(!is_expandable_w && is_expandable_h)
158 {
159 pd->is_expandable_w = EINA_FALSE;
160 pd->is_expandable_h = EINA_TRUE;
161 elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_TRUE);
162 }
163 else if(is_expandable_w && is_expandable_h)
164 {
165 pd->is_expandable_w = EINA_TRUE;
166 pd->is_expandable_h = EINA_TRUE;
167 elm_scroller_content_min_limit(pd->scroller, EINA_TRUE, EINA_TRUE);
168 }
169 else
170 {
171 pd->is_expandable_w = EINA_FALSE;
172 pd->is_expandable_h = EINA_FALSE;
173 elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE);
174 }
175}
176
177static void
178_efl_ui_popup_alert_scroll_efl_gfx_size_hint_hint_max_set(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *pd, Eina_Size2D size)
179{
180 efl_gfx_size_hint_max_set(efl_super(obj, MY_CLASS), size);
181 pd->max_scroll = size;
182 elm_layout_sizing_eval(obj);
183}
184
185EOLIAN static Eo * 92EOLIAN static Eo *
186_efl_ui_popup_alert_scroll_efl_object_constructor(Eo *obj, 93_efl_ui_popup_alert_scroll_efl_object_constructor(Eo *obj,
187 Efl_Ui_Popup_Alert_Scroll_Data *pd) 94 Efl_Ui_Popup_Alert_Scroll_Data *pd)
@@ -201,8 +108,6 @@ _efl_ui_popup_alert_scroll_efl_object_constructor(Eo *obj,
201 efl_content_set(efl_part(efl_super(obj, MY_CLASS), "elm.swallow.content"), 108 efl_content_set(efl_part(efl_super(obj, MY_CLASS), "elm.swallow.content"),
202 pd->scroller); 109 pd->scroller);
203 110
204 pd->max_scroll = EINA_SIZE2D(-1, -1);
205
206 return obj; 111 return obj;
207} 112}
208 113
diff --git a/src/lib/elementary/efl_ui_popup_alert_scroll.eo b/src/lib/elementary/efl_ui_popup_alert_scroll.eo
index b680f7644c..641a5d6899 100644
--- a/src/lib/elementary/efl_ui_popup_alert_scroll.eo
+++ b/src/lib/elementary/efl_ui_popup_alert_scroll.eo
@@ -1,24 +1,7 @@
1class Efl.Ui.Popup.Alert.Scroll(Efl.Ui.Popup.Alert) 1class Efl.Ui.Popup.Alert.Scroll(Efl.Ui.Popup.Alert)
2{ 2{
3 methods {
4 @property expandable {
5 set {
6 [[Set the expandable of popup.
7
8 If the contents of the popup has min size, popup will be increased by min size.
9 If max hint is set, it will be increased to value of max hint,
10 and then scrolling will occur.
11 ]]
12 }
13 values {
14 is_expandable_w: bool;
15 is_expandable_h: bool;
16 }
17 }
18 }
19 implements { 3 implements {
20 Efl.Object.constructor; 4 Efl.Object.constructor;
21 Efl.Gfx.Size.Hint.hint_max { set; }
22 Efl.Part.part; 5 Efl.Part.part;
23 } 6 }
24} 7}
diff --git a/src/lib/elementary/efl_ui_popup_alert_scroll_private.h b/src/lib/elementary/efl_ui_popup_alert_scroll_private.h
index 99a000146a..c1219b9398 100644
--- a/src/lib/elementary/efl_ui_popup_alert_scroll_private.h
+++ b/src/lib/elementary/efl_ui_popup_alert_scroll_private.h
@@ -6,12 +6,8 @@
6typedef struct _Efl_Ui_Popup_Alert_Scroll_Data Efl_Ui_Popup_Alert_Scroll_Data; 6typedef struct _Efl_Ui_Popup_Alert_Scroll_Data Efl_Ui_Popup_Alert_Scroll_Data;
7struct _Efl_Ui_Popup_Alert_Scroll_Data 7struct _Efl_Ui_Popup_Alert_Scroll_Data
8{ 8{
9 Eo *scroller; 9 Eo *scroller;
10 Eo *content; 10 Eo *content;
11 Eina_Size2D max_scroll;
12 Eina_Bool is_expandable_w : 1;
13 Eina_Bool is_expandable_h : 1;
14 Eina_Bool is_sizing_eval : 1;
15}; 11};
16 12
17#endif 13#endif
diff --git a/src/lib/elementary/efl_ui_popup_alert_text.c b/src/lib/elementary/efl_ui_popup_alert_text.c
index 9bf90f121d..08793ac941 100644
--- a/src/lib/elementary/efl_ui_popup_alert_text.c
+++ b/src/lib/elementary/efl_ui_popup_alert_text.c
@@ -12,23 +12,8 @@
12#define MY_CLASS EFL_UI_POPUP_ALERT_TEXT_CLASS 12#define MY_CLASS EFL_UI_POPUP_ALERT_TEXT_CLASS
13#define MY_CLASS_NAME "Efl.Ui.Popup.Alert.Text" 13#define MY_CLASS_NAME "Efl.Ui.Popup.Alert.Text"
14 14
15static void
16_scroller_sizing_eval(Eo *obj, Efl_Ui_Popup_Alert_Text_Data *pd, Evas_Coord minh)
17{
18 Eina_Rect geom = efl_gfx_geometry_get(obj);
19
20 if (pd->is_expandable_h)
21 {
22 if ((pd->max_scroll_h > -1) && (minh > pd->max_scroll_h))
23 {
24 elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE);
25 efl_gfx_size_set(obj, EINA_SIZE2D(geom.w, pd->max_scroll_h));
26 }
27 }
28}
29
30EOLIAN static void 15EOLIAN static void
31_efl_ui_popup_alert_text_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Popup_Alert_Text_Data *pd) 16_efl_ui_popup_alert_text_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Popup_Alert_Text_Data *pd EINA_UNUSED)
32{ 17{
33 elm_layout_sizing_eval(efl_super(obj, MY_CLASS)); 18 elm_layout_sizing_eval(efl_super(obj, MY_CLASS));
34 19
@@ -38,8 +23,6 @@ _efl_ui_popup_alert_text_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Popup_Alert_Text
38 elm_coords_finger_size_adjust(1, &minw, 1, &minh); 23 elm_coords_finger_size_adjust(1, &minw, 1, &minh);
39 edje_object_size_min_restricted_calc(wd->resize_obj, &minw, &minh, minw, minh); 24 edje_object_size_min_restricted_calc(wd->resize_obj, &minw, &minh, minw, minh);
40 efl_gfx_size_hint_min_set(obj, EINA_SIZE2D(minw, minh)); 25 efl_gfx_size_hint_min_set(obj, EINA_SIZE2D(minw, minh));
41
42 _scroller_sizing_eval(obj, pd, minh);
43} 26}
44 27
45static Eina_Bool 28static Eina_Bool
@@ -108,29 +91,6 @@ _efl_ui_popup_alert_text_efl_text_text_get(Eo *obj, Efl_Ui_Popup_Alert_Text_Data
108 return _efl_ui_popup_alert_text_text_get(obj, pd, "elm.text"); 91 return _efl_ui_popup_alert_text_text_get(obj, pd, "elm.text");
109} 92}
110 93
111static void
112_efl_ui_popup_alert_text_expandable_set(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Alert_Text_Data *pd, Eina_Bool is_expandable_h)
113{
114 if (is_expandable_h)
115 {
116 pd->is_expandable_h = EINA_TRUE;
117 elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_TRUE);
118 }
119 else
120 {
121 pd->is_expandable_h = EINA_FALSE;
122 elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE);
123 }
124}
125
126static void
127_efl_ui_popup_alert_text_efl_gfx_size_hint_hint_max_set(Eo *obj, Efl_Ui_Popup_Alert_Text_Data *pd, Eina_Size2D size)
128{
129 efl_gfx_size_hint_max_set(efl_super(obj, MY_CLASS), size);
130 pd->max_scroll_h = size.h;
131 elm_layout_sizing_eval(obj);
132}
133
134EOLIAN static Eo * 94EOLIAN static Eo *
135_efl_ui_popup_alert_text_efl_object_constructor(Eo *obj, 95_efl_ui_popup_alert_text_efl_object_constructor(Eo *obj,
136 Efl_Ui_Popup_Alert_Text_Data *pd) 96 Efl_Ui_Popup_Alert_Text_Data *pd)
@@ -150,8 +110,6 @@ _efl_ui_popup_alert_text_efl_object_constructor(Eo *obj,
150 efl_content_set(efl_part(efl_super(obj, MY_CLASS), "elm.swallow.content"), 110 efl_content_set(efl_part(efl_super(obj, MY_CLASS), "elm.swallow.content"),
151 pd->scroller); 111 pd->scroller);
152 112
153 pd->max_scroll_h = -1;
154
155 return obj; 113 return obj;
156} 114}
157 115
diff --git a/src/lib/elementary/efl_ui_popup_alert_text.eo b/src/lib/elementary/efl_ui_popup_alert_text.eo
index d26ac90749..b00f084696 100644
--- a/src/lib/elementary/efl_ui_popup_alert_text.eo
+++ b/src/lib/elementary/efl_ui_popup_alert_text.eo
@@ -1,23 +1,7 @@
1class Efl.Ui.Popup.Alert.Text(Efl.Ui.Popup.Alert, Efl.Text) 1class Efl.Ui.Popup.Alert.Text(Efl.Ui.Popup.Alert, Efl.Text)
2{ 2{
3 methods {
4 @property expandable {
5 set {
6 [[Set the expandable of popup.
7
8 If the contents of the popup has min size, popup will be increased by min size to the y direction.
9 If max hint is set, it will be increased to value of max hint,
10 and then scrolling will occur.
11 ]]
12 }
13 values {
14 is_expandable: bool;
15 }
16 }
17 }
18 implements { 3 implements {
19 Efl.Object.constructor; 4 Efl.Object.constructor;
20 Efl.Gfx.Size.Hint.hint_max { set;}
21 Efl.Text.text { get; set; } 5 Efl.Text.text { get; set; }
22 Efl.Part.part; 6 Efl.Part.part;
23 } 7 }
diff --git a/src/lib/elementary/efl_ui_popup_alert_text_private.h b/src/lib/elementary/efl_ui_popup_alert_text_private.h
index b911199b5d..8205630f7c 100644
--- a/src/lib/elementary/efl_ui_popup_alert_text_private.h
+++ b/src/lib/elementary/efl_ui_popup_alert_text_private.h
@@ -6,10 +6,8 @@
6typedef struct _Efl_Ui_Popup_Alert_Text_Data Efl_Ui_Popup_Alert_Text_Data; 6typedef struct _Efl_Ui_Popup_Alert_Text_Data Efl_Ui_Popup_Alert_Text_Data;
7struct _Efl_Ui_Popup_Alert_Text_Data 7struct _Efl_Ui_Popup_Alert_Text_Data
8{ 8{
9 Eo *scroller; 9 Eo *scroller;
10 Eo *message; 10 Eo *message;
11 Evas_Coord max_scroll_h;
12 Eina_Bool is_expandable_h : 1;
13}; 11};
14 12
15#endif 13#endif