summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-04-26 13:15:33 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-04-26 13:16:11 +0100
commitcd7b594466e3e9c470541b5f61069eb683e0729b (patch)
tree40616ac02e89366610da196b3dbb8fe1ebd2904d
parentd261dca06c748675add162a0dd1c7bfd992eae1d (diff)
elm - combobox - pretty borken but make it a little less
add some tests so i can see smaller comboboxes with padding and fix the scaling which was broken.
-rw-r--r--src/bin/elementary/test_combobox.c40
-rw-r--r--src/lib/elementary/elc_combobox.c6
2 files changed, 41 insertions, 5 deletions
diff --git a/src/bin/elementary/test_combobox.c b/src/bin/elementary/test_combobox.c
index ee68a3bdaf..62d21d0913 100644
--- a/src/bin/elementary/test_combobox.c
+++ b/src/bin/elementary/test_combobox.c
@@ -111,7 +111,7 @@ void
111test_combobox(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, 111test_combobox(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
112 void *event_info EINA_UNUSED) 112 void *event_info EINA_UNUSED)
113{ 113{
114 Evas_Object *win, *bx, *combobox; 114 Evas_Object *win, *bx, *combobox, *fr;
115 Elm_Genlist_Item_Class *itc; 115 Elm_Genlist_Item_Class *itc;
116 win = elm_win_util_standard_add("combobox", "Combobox"); 116 win = elm_win_util_standard_add("combobox", "Combobox");
117 elm_win_autodel_set(win, EINA_TRUE); 117 elm_win_autodel_set(win, EINA_TRUE);
@@ -129,6 +129,26 @@ test_combobox(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
129 itc->func.filter_get = gl_filter_get; 129 itc->func.filter_get = gl_filter_get;
130 itc->func.del = NULL; 130 itc->func.del = NULL;
131 131
132 fr = elm_frame_add(win);
133 elm_object_style_set(fr, "pad_huge");
134 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, 0);
135 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, 0);
136 elm_box_pack_end(bx, fr);
137 evas_object_show(fr);
138
139 combobox = elm_combobox_add(win);
140 evas_object_size_hint_weight_set(combobox, EVAS_HINT_EXPAND, 0);
141 evas_object_size_hint_align_set(combobox, EVAS_HINT_FILL, 0);
142 elm_object_part_text_set(combobox, "guide", "Short List");
143 evas_object_smart_callback_add(combobox, "expanded",
144 _combobox_expanded_cb, NULL);
145 for (int i = 0; i < 5; i++)
146 elm_genlist_item_append(combobox, itc, (void *)(uintptr_t)i,
147 NULL, ELM_GENLIST_ITEM_NONE, NULL,
148 (void*)(uintptr_t)(i * 10));
149 elm_object_content_set(fr, combobox);
150 evas_object_show(combobox);
151
132 combobox = elm_combobox_add(win); 152 combobox = elm_combobox_add(win);
133 evas_object_size_hint_weight_set(combobox, EVAS_HINT_EXPAND, 0); 153 evas_object_size_hint_weight_set(combobox, EVAS_HINT_EXPAND, 0);
134 evas_object_size_hint_align_set(combobox, EVAS_HINT_FILL, 0); 154 evas_object_size_hint_align_set(combobox, EVAS_HINT_FILL, 0);
@@ -178,6 +198,24 @@ test_combobox(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
178 elm_box_pack_end(bx, combobox); 198 elm_box_pack_end(bx, combobox);
179 evas_object_show(combobox); 199 evas_object_show(combobox);
180 200
201 fr = elm_frame_add(win);
202 elm_object_style_set(fr, "pad_huge");
203 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, 0);
204 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, 0);
205 elm_box_pack_end(bx, fr);
206 evas_object_show(fr);
207
208 combobox = elm_combobox_add(win);
209 evas_object_size_hint_weight_set(combobox, EVAS_HINT_EXPAND, 0);
210 evas_object_size_hint_align_set(combobox, EVAS_HINT_FILL, 0);
211 elm_object_part_text_set(combobox, "guide", "Short List");
212 for (int i = 0; i < 5; i++)
213 elm_genlist_item_append(combobox, itc, (void *)(uintptr_t)i,
214 NULL, ELM_GENLIST_ITEM_NONE, NULL,
215 (void*)(uintptr_t)(i * 10));
216 elm_object_content_set(fr, combobox);
217 evas_object_show(combobox);
218
181 evas_object_resize(win, 320, 500); 219 evas_object_resize(win, 320, 500);
182 evas_object_show(win); 220 evas_object_show(win);
183 221
diff --git a/src/lib/elementary/elc_combobox.c b/src/lib/elementary/elc_combobox.c
index 200745a97b..49a91c0012 100644
--- a/src/lib/elementary/elc_combobox.c
+++ b/src/lib/elementary/elc_combobox.c
@@ -209,10 +209,8 @@ _table_resize(void *data)
209 else win_y_offset = obj_y; 209 else win_y_offset = obj_y;
210 210
211 if (current_height < win_y_offset) 211 if (current_height < win_y_offset)
212 evas_object_size_hint_min_set(sd->spacer, obj_w * elm_config_scale_get(), 212 evas_object_size_hint_min_set(sd->spacer, obj_w, current_height);
213 current_height + (2 * elm_config_scale_get())); 213 else evas_object_size_hint_min_set(sd->spacer, obj_w, win_y_offset);
214 else evas_object_size_hint_min_set(sd->spacer, obj_w * elm_config_scale_get(),
215 win_y_offset * elm_config_scale_get());
216 } 214 }
217} 215}
218 216