forked from enlightenment/efl
efl_ui_tab_page: remove part
I introduced the property for item a few patches earlier. I do not want to use a part for this, as i would have to implement the class twice (Once in the part, once as a selfstanding object). It would also be kind of weird to have code like: efl_content_set(efl_part(efl_part("item"), "tab"),bla). The purpose of this part also got a little bit replaced when the item was introduced, as this is the central point of data for the tab bar icon. So need for an additional editition part. Reviewed-by: WooHyun Jung <woohyun0705@gmail.com> Differential Revision: https://phab.enlightenment.org/D9728
This commit is contained in:
parent
3c4a870910
commit
f52a0b25f3
|
@ -87,8 +87,9 @@ tab_page_add(Eo *parent)
|
|||
|
||||
tab_page = efl_add(EFL_UI_TAB_PAGE_CLASS, parent);
|
||||
efl_content_set(tab_page, content);
|
||||
efl_text_set(efl_part(tab_page, "tab"), label);
|
||||
efl_ui_tab_page_part_tab_icon_set(efl_part(tab_page, "tab"), icon);
|
||||
Eo *item = efl_ui_tab_page_tab_bar_item_get(tab_page);
|
||||
efl_text_set(item, label);
|
||||
efl_ui_tab_bar_default_item_icon_set(item, icon);
|
||||
|
||||
return tab_page;
|
||||
}
|
||||
|
@ -472,7 +473,7 @@ _change_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
|||
if (efl_ui_selectable_selected_get(tcd->label_check))
|
||||
{
|
||||
label = tab_label_get();
|
||||
efl_text_set(efl_part(tab_page, "tab"), label);
|
||||
efl_text_set(efl_ui_tab_page_tab_bar_item_get(tab_page), label);
|
||||
content = content_add(tab_page, label);
|
||||
efl_content_set(tab_page, content);
|
||||
}
|
||||
|
@ -480,7 +481,7 @@ _change_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
|||
if (efl_ui_selectable_selected_get(tcd->icon_check))
|
||||
{
|
||||
icon = tab_icon_get();
|
||||
efl_ui_tab_page_part_tab_icon_set(efl_part(tab_page, "tab"), icon);
|
||||
efl_ui_tab_bar_default_item_icon_set(efl_ui_tab_page_tab_bar_item_get(tab_page), icon);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -275,7 +275,6 @@ typedef Eo Efl_Ui_Spotlight_Indicator;
|
|||
# include <efl_ui_tab_bar_default_item.eo.h>
|
||||
# include <efl_ui_tab_bar.eo.h>
|
||||
# include <efl_ui_tab_page.eo.h>
|
||||
# include <efl_ui_tab_page_part_tab.eo.h>
|
||||
# include <efl_ui_tab_pager.eo.h>
|
||||
/**
|
||||
* Initialize Elementary
|
||||
|
|
|
@ -90,56 +90,6 @@ _efl_ui_tab_page_efl_object_destructor(Eo *obj, Efl_Ui_Tab_Page_Data *sd EINA_UN
|
|||
efl_destructor(efl_super(obj, MY_CLASS));
|
||||
}
|
||||
|
||||
/* Efl.Part begin */
|
||||
|
||||
EOLIAN static Eo *
|
||||
_efl_ui_tab_page_efl_part_part_get(const Eo *obj, Efl_Ui_Tab_Page_Data *sd EINA_UNUSED, const char *part)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
|
||||
|
||||
if (eina_streq(part, "tab"))
|
||||
return ELM_PART_IMPLEMENT(EFL_UI_TAB_PAGE_PART_TAB_CLASS, obj, part);
|
||||
|
||||
return efl_part_get(efl_super(obj, MY_CLASS), part);
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_tab_page_part_tab_icon_set(Eo *obj, void *_pd EINA_UNUSED, const char *path)
|
||||
{
|
||||
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
|
||||
Efl_Ui_Tab_Page_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_TAB_PAGE_CLASS);
|
||||
|
||||
eina_stringshare_replace(&sd->tab_icon, path);
|
||||
efl_ui_tab_bar_default_item_icon_set(sd->tab_bar_icon, sd->tab_icon);
|
||||
}
|
||||
|
||||
EOLIAN static const char *
|
||||
_efl_ui_tab_page_part_tab_icon_get(const Eo *obj, void *_pd EINA_UNUSED)
|
||||
{
|
||||
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
|
||||
Efl_Ui_Tab_Page_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_TAB_PAGE_CLASS);
|
||||
|
||||
return sd->tab_icon;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_tab_page_part_tab_efl_text_text_set(Eo *obj, void *_pd EINA_UNUSED, const char *text)
|
||||
{
|
||||
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
|
||||
Efl_Ui_Tab_Page_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_TAB_PAGE_CLASS);
|
||||
|
||||
eina_stringshare_replace(&sd->tab_label, text);
|
||||
efl_text_set(sd->tab_bar_icon, sd->tab_label);
|
||||
}
|
||||
|
||||
EOLIAN static const char *
|
||||
_efl_ui_tab_page_part_tab_efl_text_text_get(const Eo *obj, void *_pd EINA_UNUSED)
|
||||
{
|
||||
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
|
||||
Efl_Ui_Tab_Page_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_TAB_PAGE_CLASS);
|
||||
|
||||
return sd->tab_label;
|
||||
}
|
||||
|
||||
EOLIAN static Efl_Ui_Tab_Bar_Default_Item*
|
||||
_efl_ui_tab_page_tab_bar_item_get(const Eo *obj, Efl_Ui_Tab_Page_Data *pd)
|
||||
|
@ -154,9 +104,6 @@ _efl_ui_tab_page_tab_bar_item_get(const Eo *obj, Efl_Ui_Tab_Page_Data *pd)
|
|||
return pd->tab_bar_icon;
|
||||
}
|
||||
|
||||
|
||||
#include "efl_ui_tab_page_part_tab.eo.c"
|
||||
|
||||
/* Efl.Part end */
|
||||
|
||||
#include "efl_ui_tab_page.eo.c"
|
||||
|
|
|
@ -16,14 +16,10 @@ class @beta Efl.Ui.Tab_Page extends Efl.Ui.Layout_Base implements Efl.Content
|
|||
}
|
||||
}
|
||||
}
|
||||
parts {
|
||||
tab: Efl.Ui.Tab_Page_Part_Tab;
|
||||
}
|
||||
implements {
|
||||
Efl.Object.constructor;
|
||||
Efl.Object.destructor;
|
||||
Efl.Content.content { get; set; }
|
||||
Efl.Content.content_unset;
|
||||
Efl.Part.part_get;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
class @beta Efl.Ui.Tab_Page_Part_Tab extends Efl.Ui.Layout_Part implements Efl.Text
|
||||
{
|
||||
[[Tab_Page internal part class]]
|
||||
data: null;
|
||||
methods {
|
||||
@property icon {
|
||||
values {
|
||||
path: string;
|
||||
}
|
||||
}
|
||||
}
|
||||
implements {
|
||||
Efl.Text.text { get; set; }
|
||||
}
|
||||
}
|
|
@ -157,7 +157,6 @@ pub_eo_files = [
|
|||
'efl_ui_tab_pager.eo',
|
||||
'efl_ui_tab_bar.eo',
|
||||
'efl_ui_tab_page.eo',
|
||||
'efl_ui_tab_page_part_tab.eo',
|
||||
'efl_ui_widget_focus_manager.eo',
|
||||
'efl_ui_legacy.eo',
|
||||
'efl_ui_button_legacy_part.eo',
|
||||
|
|
Loading…
Reference in New Issue