rimmed pushed a commit to branch master. http://git.enlightenment.org/tools/eflete.git/commit/?id=8d63dfc69974d8caf5f2a0515398c526ae446719
commit 8d63dfc69974d8caf5f2a0515398c526ae446719 Author: Andrii Kroitor <[email protected]> Date: Fri Jan 15 10:42:57 2016 +0200 main_window: remove elm_widget_sub_object_add hack this hack allowed to bypass genlist item styles issues, but as side effect it was producing errors on app close. --- data/themes/default/widgets/layouts/tabs.edc | 82 ++++++++++++++++++++++++++++ src/bin/ui/main_window.c | 23 ++------ 2 files changed, 87 insertions(+), 18 deletions(-) diff --git a/data/themes/default/widgets/layouts/tabs.edc b/data/themes/default/widgets/layouts/tabs.edc index dc98663..71dc278 100644 --- a/data/themes/default/widgets/layouts/tabs.edc +++ b/data/themes/default/widgets/layouts/tabs.edc @@ -33,6 +33,88 @@ group { name: "elm/layout/tabs/default"; } } +group { name: "elm/layout/tabs/property"; + parts { + part { name: "elm.swallow.toolbar"; + type: SWALLOW; + description { state: "default" 0.0; + max: -1 27; + align: 0.0 0.0; + } + } + part { name: "bg_content"; + type: RECT; + description { + color: 81 82 84 255; + rel1 { + relative: 0.0 1.0; + to: "elm.swallow.toolbar"; + } + } + } + part { name: "elm.swallow.property"; + type: SWALLOW; + description { state: "default" 0.0; + visible: 0; + rel1 { + offset: 3 3; + relative: 0.0 1.0; + to: "elm.swallow.toolbar"; + } + rel2 { + offset: -4 -4; + } + } + description { state: "property" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { state: "history" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { name: "elm.swallow.history"; + type: SWALLOW; + description { state: "default" 0.0; + visible: 0; + rel1 { + offset: 3 3; + relative: 0.0 1.0; + to: "elm.swallow.toolbar"; + } + rel2 { + offset: -4 -4; + } + } + description { state: "history" 0.0; + inherit: "default" 0.0; + visible: 1; + } + description { state: "property" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + } + programs { + program { name: "property_show"; + signal: "property,show"; + source: "eflete"; + action: STATE_SET "property" 0.0; + target: "elm.swallow.history"; + target: "elm.swallow.property"; + } + program { name: "history_show"; + signal: "history,show"; + source: "eflete"; + action: STATE_SET "history" 0.0; + target: "elm.swallow.history"; + target: "elm.swallow.property"; + } + } +} + group { name: "elm/layout/tab_home/default"; images { image: "section-border.png" COMP; diff --git a/src/bin/ui/main_window.c b/src/bin/ui/main_window.c index 52390e3..0c3392d 100644 --- a/src/bin/ui/main_window.c +++ b/src/bin/ui/main_window.c @@ -78,31 +78,19 @@ ui_main_window_del(void) return true; } -/* - * It's necessary to avoid warning: implicit declaration of function - * 'elm_widget_sub_object_add' on compilation stage, which occurrs because of - * Elementary.h file isn't contain directly elm_widget.h file (where - * 'elm_widget_sub_object_add' function declared) - */ -Eina_Bool elm_widget_sub_object_add(Evas_Object *obj, Evas_Object *sobj); - static void _history_click(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - evas_object_hide(elm_layout_content_unset(ap.block.right_top, NULL)); - elm_widget_sub_object_add(ap.block.right_top, ap.block.property); - elm_layout_content_set(ap.block.right_top, NULL, ap.block.history); + elm_layout_signal_emit(ap.block.right_top, "history,show", "eflete"); } static void _property_click(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - evas_object_hide(elm_layout_content_unset(ap.block.right_top, NULL)); - elm_widget_sub_object_add(ap.block.right_top, ap.block.history); - elm_layout_content_set(ap.block.right_top, NULL, ap.block.property); + elm_layout_signal_emit(ap.block.right_top, "property,show", "eflete"); } Eina_Bool @@ -173,7 +161,7 @@ ui_main_window_add(void) /* add tabs with history and signals */ ap.block.right_top = elm_layout_add(ap.win); - elm_layout_theme_set(ap.block.right_top, "layout", "tabs", "default"); + elm_layout_theme_set(ap.block.right_top, "layout", "tabs", "property"); toolbar = elm_toolbar_add(ap.block.right_top); elm_object_style_set(toolbar, "editor_tabs_horizontal"); @@ -188,10 +176,9 @@ ui_main_window_add(void) elm_toolbar_item_append(toolbar, NULL, _("History"), _history_click, NULL); ap.block.property = ui_property_add(ap.win); - elm_layout_content_set(ap.block.right_top, NULL, ap.block.property); + elm_layout_content_set(ap.block.right_top, "elm.swallow.property", ap.block.property); ap.block.history = history_ui_add(); - evas_object_hide(ap.block.history); - elm_layout_content_set(ap.block.right_top, NULL, ap.block.property); + elm_layout_content_set(ap.block.right_top, "elm.swallow.history", ap.block.history); elm_object_part_content_set(ap.panes.right, "right", ap.block.right_top); ap.menu = ui_menu_add(); --
