summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-07-31 14:36:13 -0400
committerCedric BAIL <cedric.bail@free.fr>2019-07-31 14:00:15 -0700
commit02f1ce8d54096e9de7088c8f09981178306afeed (patch)
tree976e7e6386308f15fe36c7bdbff70bf26b84f0e8 /src/lib
parent407a0aa3671c726f9f311f9586e8555919a55f04 (diff)
elm/colorselector: go back to using elm_box internally
legacy widgets should not use efl_ui widgets internally and vice versa reverts b11f3717036bc4675fde5ffbc26775262a184465 Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D9465
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/elementary/elm_colorselector.c40
1 files changed, 15 insertions, 25 deletions
diff --git a/src/lib/elementary/elm_colorselector.c b/src/lib/elementary/elm_colorselector.c
index c45bedba61..eee8ea076d 100644
--- a/src/lib/elementary/elm_colorselector.c
+++ b/src/lib/elementary/elm_colorselector.c
@@ -1348,9 +1348,8 @@ _elm_colorselector_efl_ui_widget_theme_apply(Eo *obj, Elm_Colorselector_Data *sd
1348 vpadstr = edje_object_data_get 1348 vpadstr = edje_object_data_get
1349 (wd->resize_obj, "vertical_pad"); 1349 (wd->resize_obj, "vertical_pad");
1350 if (vpadstr) v_pad = atoi(vpadstr); 1350 if (vpadstr) v_pad = atoi(vpadstr);
1351
1352 scale = efl_gfx_entity_scale_get(obj) * elm_config_scale_get() / edje_object_base_scale_get(wd->resize_obj); 1351 scale = efl_gfx_entity_scale_get(obj) * elm_config_scale_get() / edje_object_base_scale_get(wd->resize_obj);
1353 efl_gfx_arrangement_content_padding_set(sd->palette_box, h_pad * scale, v_pad * scale, 0); 1352 elm_box_padding_set(sd->palette_box, h_pad * scale, v_pad * scale);
1354 1353
1355 EINA_LIST_FOREACH(sd->items, elist, eo_item) 1354 EINA_LIST_FOREACH(sd->items, elist, eo_item)
1356 { 1355 {
@@ -1535,7 +1534,7 @@ _elm_colorselector_efl_canvas_group_calculate(Eo *obj, Elm_Colorselector_Data *s
1535 return; 1534 return;
1536 } 1535 }
1537 1536
1538 efl_pack_layout_request(sd->palette_box); 1537 efl_canvas_group_calculate(sd->palette_box);
1539 edje_object_size_min_calc(wd->resize_obj, &minw, &minh); 1538 edje_object_size_min_calc(wd->resize_obj, &minw, &minh);
1540 evas_object_size_hint_min_set(obj, minw, minh); 1539 evas_object_size_hint_min_set(obj, minw, minh);
1541} 1540}
@@ -1873,7 +1872,7 @@ _palette_colors_load(Evas_Object *obj)
1873 item->color->b = color->b; 1872 item->color->b = color->b;
1874 item->color->a = color->a; 1873 item->color->a = color->a;
1875 1874
1876 efl_pack(sd->palette_box, VIEW(item)); 1875 elm_box_pack_end(sd->palette_box, VIEW(item));
1877 evas_object_color_set(item->color_obj, 1876 evas_object_color_set(item->color_obj,
1878 (item->color->r * item->color->a) / 255, 1877 (item->color->r * item->color->a) / 255,
1879 (item->color->g * item->color->a) / 255, 1878 (item->color->g * item->color->a) / 255,
@@ -1886,14 +1885,6 @@ _palette_colors_load(Evas_Object *obj)
1886 sd->config_load = EINA_TRUE; 1885 sd->config_load = EINA_TRUE;
1887} 1886}
1888 1887
1889static inline void
1890_palette_box_prepare(Eo *o)
1891{
1892 efl_ui_layout_orientation_set(o, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL);
1893 efl_gfx_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1894 efl_gfx_entity_visible_set(o, EINA_FALSE);
1895}
1896
1897static void 1888static void
1898_create_colorpalette(Evas_Object *obj) 1889_create_colorpalette(Evas_Object *obj)
1899{ 1890{
@@ -1906,16 +1897,15 @@ _create_colorpalette(Evas_Object *obj)
1906 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); 1897 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
1907 1898
1908 if (sd->palette_box) return; 1899 if (sd->palette_box) return;
1909 if (elm_widget_is_legacy(obj)) 1900 sd->palette_box = elm_box_add(obj);
1910 { 1901 elm_box_layout_set
1911 sd->palette_box = elm_legacy_add(EFL_UI_BOX_FLOW_CLASS, obj); 1902 (sd->palette_box, evas_object_box_layout_flow_horizontal, NULL, NULL);
1912 evas_object_size_hint_align_set(sd->palette_box, EVAS_HINT_FILL, EVAS_HINT_FILL); 1903 elm_box_horizontal_set(sd->palette_box, EINA_TRUE);
1913 } 1904 evas_object_size_hint_weight_set
1914 else 1905 (sd->palette_box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1915 { 1906 evas_object_size_hint_align_set
1916 sd->palette_box = efl_add(EFL_UI_BOX_FLOW_CLASS, obj); 1907 (sd->palette_box, EVAS_HINT_FILL, EVAS_HINT_FILL);
1917 } 1908 elm_box_homogeneous_set(sd->palette_box, EINA_TRUE);
1918 _palette_box_prepare(sd->palette_box);
1919 1909
1920 hpadstr = edje_object_data_get(wd->resize_obj, "horizontal_pad"); 1910 hpadstr = edje_object_data_get(wd->resize_obj, "horizontal_pad");
1921 if (hpadstr) h_pad = atoi(hpadstr); 1911 if (hpadstr) h_pad = atoi(hpadstr);
@@ -1923,8 +1913,8 @@ _create_colorpalette(Evas_Object *obj)
1923 if (vpadstr) v_pad = atoi(vpadstr); 1913 if (vpadstr) v_pad = atoi(vpadstr);
1924 1914
1925 scale = efl_gfx_entity_scale_get(obj) * elm_config_scale_get() / edje_object_base_scale_get(wd->resize_obj); 1915 scale = efl_gfx_entity_scale_get(obj) * elm_config_scale_get() / edje_object_base_scale_get(wd->resize_obj);
1926 efl_gfx_arrangement_content_padding_set(sd->palette_box, h_pad * scale, v_pad * scale, 0); 1916 elm_box_padding_set(sd->palette_box, h_pad * scale, v_pad * scale);
1927 efl_gfx_arrangement_content_align_set(sd->palette_box, 0.0, 0.0); 1917 elm_box_align_set(sd->palette_box, 0.0, 0.0);
1928 if (!elm_layout_content_set(obj, "elm.palette", sd->palette_box)) 1918 if (!elm_layout_content_set(obj, "elm.palette", sd->palette_box))
1929 elm_layout_content_set(obj, "palette", sd->palette_box); 1919 elm_layout_content_set(obj, "palette", sd->palette_box);
1930 sd->palette_name = eina_stringshare_add("default"); 1920 sd->palette_name = eina_stringshare_add("default");
@@ -2465,7 +2455,7 @@ _elm_colorselector_palette_color_add(Eo *obj, Elm_Colorselector_Data *sd, int r,
2465 item->color->b = b; 2455 item->color->b = b;
2466 item->color->a = a; 2456 item->color->a = a;
2467 2457
2468 efl_pack(sd->palette_box, VIEW(item)); 2458 elm_box_pack_end(sd->palette_box, VIEW(item));
2469 evas_object_color_set(item->color_obj, 2459 evas_object_color_set(item->color_obj,
2470 (item->color->r * item->color->a) / 255, 2460 (item->color->r * item->color->a) / 255,
2471 (item->color->g * item->color->a) / 255, 2461 (item->color->g * item->color->a) / 255,