summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2021-03-23 21:09:47 +0000
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2021-03-23 21:09:47 +0000
commit49ac4121cf8fe52316faf2829d348c51d7ac7a5e (patch)
tree0ff17d420b836a7f15d9e2d57d70078a27c7fe6d
parent5f4524295a623117c58955c839c34462197b1197 (diff)
downloadefl-49ac4121cf8fe52316faf2829d348c51d7ac7a5e.tar.gz
elm - efl ui tab - raise the selected tab item obj so we can do tabs
need stacking to relfect tabs if the theme wants to look like tabs... which is what i am doing with flat.
-rw-r--r--src/lib/elementary/efl_ui_tab_bar.c47
1 files changed, 39 insertions, 8 deletions
diff --git a/src/lib/elementary/efl_ui_tab_bar.c b/src/lib/elementary/efl_ui_tab_bar.c
index da5ca2c43d..321b434176 100644
--- a/src/lib/elementary/efl_ui_tab_bar.c
+++ b/src/lib/elementary/efl_ui_tab_bar.c
@@ -23,7 +23,10 @@ _efl_ui_tab_bar_efl_ui_single_selectable_fallback_selection_set(Eo *obj EINA_UNU
{
pd->fallback_selection = fallback;
if (!pd->selected)
- efl_ui_selectable_selected_set(pd->fallback_selection, EINA_TRUE);
+ {
+ efl_ui_selectable_selected_set(pd->fallback_selection, EINA_TRUE);
+ if (pd->selected) evas_object_raise(pd->selected);
+ }
}
EOLIAN static void
@@ -64,7 +67,10 @@ _selelction_change_cb(void *data, const Efl_Event *ev)
if (!pd->in_value_change)
{
if (!pd->selected && pd->fallback_selection)
- efl_ui_selectable_selected_set(pd->fallback_selection, EINA_TRUE);
+ {
+ efl_ui_selectable_selected_set(pd->fallback_selection, EINA_TRUE);
+ if (pd->selected) evas_object_raise(pd->selected);
+ }
}
}
else
@@ -76,6 +82,7 @@ _selelction_change_cb(void *data, const Efl_Event *ev)
EINA_SAFETY_ON_FALSE_RETURN(!pd->selected);
pd->selected = ev->object;
efl_event_callback_call(data, EFL_UI_EVENT_ITEM_SELECTED, NULL);
+ if (pd->selected) evas_object_raise(pd->selected);
}
if (!pd->in_value_change)
{
@@ -187,40 +194,60 @@ _efl_ui_tab_bar_efl_pack_unpack(Eo *obj, Efl_Ui_Tab_Bar_Data *pd, Efl_Gfx_Entity
EOLIAN static Eina_Bool
_efl_ui_tab_bar_efl_pack_linear_pack_begin(Eo *obj, Efl_Ui_Tab_Bar_Data *pd, Efl_Gfx_Entity *subobj)
{
+ Eina_Bool val;
+
EINA_SAFETY_ON_FALSE_RETURN_VAL(_register_item(obj, pd, subobj), EINA_FALSE);
- return efl_pack_begin(pd->bx, subobj);
+ val = efl_pack_begin(pd->bx, subobj);
+ if (pd->selected) evas_object_raise(pd->selected);
+ return val;
}
EOLIAN static Eina_Bool
_efl_ui_tab_bar_efl_pack_linear_pack_end(Eo *obj, Efl_Ui_Tab_Bar_Data *pd, Efl_Gfx_Entity *subobj)
{
+ Eina_Bool val;
+
EINA_SAFETY_ON_FALSE_RETURN_VAL(_register_item(obj, pd, subobj), EINA_FALSE);
- return efl_pack_end(pd->bx, subobj);
+ val = efl_pack_end(pd->bx, subobj);
+ if (pd->selected) evas_object_raise(pd->selected);
+ return val;
}
EOLIAN static Eina_Bool
_efl_ui_tab_bar_efl_pack_linear_pack_before(Eo *obj, Efl_Ui_Tab_Bar_Data *pd, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing)
{
+ Eina_Bool val;
+
if (existing)
EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_pack_index_get(pd->bx, existing) >= 0, EINA_FALSE);
EINA_SAFETY_ON_FALSE_RETURN_VAL(_register_item(obj, pd, subobj), EINA_FALSE);
- return efl_pack_before(pd->bx, subobj, existing);
+ val = efl_pack_before(pd->bx, subobj, existing);
+ if (pd->selected) evas_object_raise(pd->selected);
+ return val;
}
EOLIAN static Eina_Bool
_efl_ui_tab_bar_efl_pack_linear_pack_after(Eo *obj, Efl_Ui_Tab_Bar_Data *pd, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing)
{
+ Eina_Bool val;
+
if (existing)
EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_pack_index_get(pd->bx, existing) >= 0, EINA_FALSE);
EINA_SAFETY_ON_FALSE_RETURN_VAL(_register_item(obj, pd, subobj), EINA_FALSE);
- return efl_pack_after(pd->bx, subobj, existing);
+ val = efl_pack_after(pd->bx, subobj, existing);
+ if (pd->selected) evas_object_raise(pd->selected);
+ return val;
}
EOLIAN static Eina_Bool
_efl_ui_tab_bar_efl_pack_linear_pack_at(Eo *obj, Efl_Ui_Tab_Bar_Data *pd, Efl_Gfx_Entity *subobj, int index)
{
+ Eina_Bool val;
+
EINA_SAFETY_ON_FALSE_RETURN_VAL(_register_item(obj, pd, subobj), EINA_FALSE);
- return efl_pack_at(pd->bx, subobj, index);
+ val = efl_pack_at(pd->bx, subobj, index);
+ if (pd->selected) evas_object_raise(pd->selected);
+ return val;
}
EOLIAN static int
@@ -245,8 +272,12 @@ _efl_ui_tab_bar_efl_pack_linear_pack_unpack_at(Eo *obj, Efl_Ui_Tab_Bar_Data *pd,
EOLIAN static Eina_Bool
_efl_ui_tab_bar_efl_pack_pack(Eo *obj, Efl_Ui_Tab_Bar_Data *pd, Efl_Gfx_Entity *subobj)
{
+ Eina_Bool val;
+
EINA_SAFETY_ON_FALSE_RETURN_VAL(_register_item(obj, pd, subobj), EINA_FALSE);
- return efl_pack(pd->bx, subobj);
+ val = efl_pack(pd->bx, subobj);
+ if (pd->selected) evas_object_raise(pd->selected);
+ return val;
}
#include "efl_ui_tab_bar.eo.c"