rimmed pushed a commit to branch master.

http://git.enlightenment.org/tools/eflete.git/commit/?id=fa78d913e68ebf55e1d2ea83ca01688a8085409a

commit fa78d913e68ebf55e1d2ea83ca01688a8085409a
Author: Vitalii Vorobiov <vi.vorob...@samsung.com>
Date:   Tue Feb 2 18:01:33 2016 +0000

    main_window: disable history tab when DEMO or editors are shown
---
 src/bin/eflete.h         |  1 +
 src/bin/ui/main_window.c | 29 +++++++++++++++++++++++++++--
 2 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/src/bin/eflete.h b/src/bin/eflete.h
index 61e7f05..912b4a4 100644
--- a/src/bin/eflete.h
+++ b/src/bin/eflete.h
@@ -106,6 +106,7 @@ struct _App_Data
       Evas_Object *signal_list;
       Evas_Object *bottom_right;
       Evas_Object *right_top, *history, *property;
+      Elm_Object_Item *item_history, *item_property;
       Evas_Object *canvas;
    } block;
    Live_View *live_view;
diff --git a/src/bin/ui/main_window.c b/src/bin/ui/main_window.c
index bcac0f9..6acd8dc 100644
--- a/src/bin/ui/main_window.c
+++ b/src/bin/ui/main_window.c
@@ -93,6 +93,23 @@ _property_click(void *data __UNUSED__,
    elm_layout_signal_emit(ap.block.right_top, "property,show", "eflete");
 }
 
+static void
+_show_history(void *data __UNUSED__,
+              Evas_Object *obj __UNUSED__,
+              void *event_info __UNUSED__)
+{
+   elm_object_item_disabled_set(ap.block.item_history, false);
+}
+
+static void
+_hide_history(void *data __UNUSED__,
+              Evas_Object *obj __UNUSED__,
+              void *event_info __UNUSED__)
+{
+   elm_object_item_disabled_set(ap.block.item_history, true);
+   elm_toolbar_item_selected_set(ap.block.item_property, true);
+}
+
 Eina_Bool
 ui_main_window_add(void)
 {
@@ -172,8 +189,16 @@ ui_main_window_add(void)
    evas_object_size_hint_align_set(toolbar, EVAS_HINT_FILL, EVAS_HINT_FILL);
    elm_toolbar_align_set(toolbar, 0.0);
 
-   elm_toolbar_item_append(toolbar, NULL, _("Properties"), _property_click, 
NULL);
-   elm_toolbar_item_append(toolbar, NULL, _("History"), _history_click, NULL);
+   ap.block.item_property = elm_toolbar_item_append(toolbar, NULL, 
_("Properties"), _property_click, NULL);
+   ap.block.item_history = elm_toolbar_item_append(toolbar, NULL, 
_("History"), _history_click, NULL);
+   elm_object_item_disabled_set(ap.block.item_history, true);
+
+   evas_object_smart_callback_add(ap.win, SIGNAL_DIFFERENT_TAB_CLICKED, 
_hide_history, NULL);
+   evas_object_smart_callback_add(ap.win, SIGNAL_IMAGE_EDITOR_TAB_CLICKED, 
_hide_history, NULL);
+   evas_object_smart_callback_add(ap.win, SIGNAL_SOUND_EDITOR_TAB_CLICKED, 
_hide_history, NULL);
+   evas_object_smart_callback_add(ap.win, SIGNAL_STYLE_EDITOR_TAB_CLICKED, 
_hide_history, NULL);
+   evas_object_smart_callback_add(ap.win, SIGNAL_COLOR_EDITOR_TAB_CLICKED, 
_hide_history, NULL);
+   evas_object_smart_callback_add(ap.win, SIGNAL_TAB_CHANGED, _show_history, 
NULL);
 
    ap.block.property = ui_property_add(ap.win);
    elm_layout_content_set(ap.block.right_top, "elm.swallow.property", 
ap.block.property);

-- 


Reply via email to