rimmed pushed a commit to branch master.

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

commit 69ebe9efac0714633fdf2857fca9eb11eefcd9e1
Author: Vyacheslav Reutskiy <v.reuts...@samsung.com>
Date:   Thu Mar 31 16:22:35 2016 +0300

    menu: add item "Fit container in workpace"
    
    Change-Id: I63d01f49988164ecb3bc1c4269639b91cd851317
---
 src/bin/common/signals.h         |  1 +
 src/bin/ui/main_window.h         |  1 +
 src/bin/ui/menu.c                |  5 +++++
 src/bin/ui/tabs.c                | 10 ++++++++++
 src/bin/ui/workspace/workspace.c |  2 ++
 5 files changed, 19 insertions(+)

diff --git a/src/bin/common/signals.h b/src/bin/common/signals.h
index e8af42e..9d54a23 100644
--- a/src/bin/common/signals.h
+++ b/src/bin/common/signals.h
@@ -474,6 +474,7 @@ typedef struct {
 #define SIGNAL_SHORTCUT_ZOOM_OUT "SIGNAL_SHORTCUT_ZOOM_OUT"
 #define SIGNAL_SHORTCUT_ZOOM_RESET "SIGNAL_SHORTCUT_ZOOM_RESET"
 #define SIGNAL_SHORTCUT_FILL "SIGNAL_SHORTCUT_FILL"
+#define SIGNAL_SHORTCUT_FIT "SIGNAL_SHORTCUT_FIT"
 #define SIGNAL_SHORTCUT_OBJECT_AREA "SIGNAL_SHORTCUT_OBJECT_AREA"
 
 /**
diff --git a/src/bin/ui/main_window.h b/src/bin/ui/main_window.h
index 94738e5..dce5fdb 100644
--- a/src/bin/ui/main_window.h
+++ b/src/bin/ui/main_window.h
@@ -75,6 +75,7 @@ enum Menu_Item
       MENU_VIEW_WORKSPACE_ZOOM_IN,
       MENU_VIEW_WORKSPACE_ZOOM_OUT,
       MENU_VIEW_WORKSPACE_ZOOM_RESET,
+      MENU_VIEW_WORKSPACE_FIT,
       MENU_VIEW_WORKSPACE_FILL,
       MENU_VIEW_WORKSPACE_OBJECT_AREA,
       MENU_VIEW_RULERS_SHOW,
diff --git a/src/bin/ui/menu.c b/src/bin/ui/menu.c
index 873d3e9..4832912 100644
--- a/src/bin/ui/menu.c
+++ b/src/bin/ui/menu.c
@@ -47,6 +47,7 @@ int MENU_ITEMS_LIST_STYLE_ONLY[] = {
    MENU_VIEW_WORKSPACE_ZOOM_IN,
    MENU_VIEW_WORKSPACE_ZOOM_OUT,
    MENU_VIEW_WORKSPACE_ZOOM_RESET,
+   MENU_VIEW_WORKSPACE_FIT,
    MENU_VIEW_WORKSPACE_FILL,
    MENU_VIEW_WORKSPACE_OBJECT_AREA,
    MENU_VIEW_RULERS_SHOW,
@@ -145,6 +146,9 @@ _menu_cb(void *data __UNUSED__,
       case MENU_VIEW_WORKSPACE_ZOOM_RESET:
          evas_object_smart_callback_call(ap.win, SIGNAL_SHORTCUT_ZOOM_RESET, 
NULL);
          break;
+      case MENU_VIEW_WORKSPACE_FIT:
+         evas_object_smart_callback_call(ap.win, SIGNAL_SHORTCUT_FIT, NULL);
+         break;
       case MENU_VIEW_WORKSPACE_FILL:
          evas_object_smart_callback_call(ap.win, SIGNAL_SHORTCUT_FILL, NULL);
          break;
@@ -305,6 +309,7 @@ ui_menu_add(void)
       ITEM_MENU_ADD(MENU_VIEW, MENU_VIEW_WORKSPACE_ZOOM_IN, NULL, _("Zoom 
in"), "+")
       ITEM_MENU_ADD(MENU_VIEW, MENU_VIEW_WORKSPACE_ZOOM_OUT, NULL, _("Zoom 
out"), "-")
       ITEM_MENU_ADD(MENU_VIEW, MENU_VIEW_WORKSPACE_ZOOM_RESET, NULL, _("Reset 
zoom"), "/")
+      ITEM_MENU_ADD(MENU_VIEW, MENU_VIEW_WORKSPACE_FIT, NULL, _("Fit container 
in Workspace"), NULL)
       ITEM_MENU_ADD(MENU_VIEW, MENU_VIEW_WORKSPACE_FILL, NULL, _("Fill 
workspace"), NULL)
       ___(MENU_VIEW);
       ITEM_MENU_ADD(MENU_VIEW, MENU_VIEW_WORKSPACE_OBJECT_AREA, NULL, _("Show 
object area"), "o")
diff --git a/src/bin/ui/tabs.c b/src/bin/ui/tabs.c
index 3ee13c7..c8ff9cc 100644
--- a/src/bin/ui/tabs.c
+++ b/src/bin/ui/tabs.c
@@ -798,6 +798,15 @@ _shortcut_fill_cb(void *data __UNUSED__,
 }
 
 static void
+_shortcut_fit_cb(void *data __UNUSED__,
+                 Evas_Object *obj __UNUSED__,
+                 void *event_info __UNUSED__)
+{
+   if (tabs.current_workspace)
+     workspace_container_fit(tabs.current_workspace);
+}
+
+static void
 _shortcut_object_area_cb(void *data __UNUSED__,
                          Evas_Object *obj __UNUSED__,
                          void *event_info __UNUSED__)
@@ -933,6 +942,7 @@ tabs_add(void)
    evas_object_smart_callback_add(ap.win, SIGNAL_SHORTCUT_ZOOM_IN, 
_shortcut_zoom_in_cb, NULL);
    evas_object_smart_callback_add(ap.win, SIGNAL_SHORTCUT_ZOOM_OUT, 
_shortcut_zoom_out_cb, NULL);
    evas_object_smart_callback_add(ap.win, SIGNAL_SHORTCUT_ZOOM_RESET, 
_shortcut_zoom_reset_cb, NULL);
+   evas_object_smart_callback_add(ap.win, SIGNAL_SHORTCUT_FIT, 
_shortcut_fit_cb, NULL);
    evas_object_smart_callback_add(ap.win, SIGNAL_SHORTCUT_FILL, 
_shortcut_fill_cb, NULL);
    evas_object_smart_callback_add(ap.win, SIGNAL_SHORTCUT_OBJECT_AREA, 
_shortcut_object_area_cb, NULL);
    return tabs.layout;
diff --git a/src/bin/ui/workspace/workspace.c b/src/bin/ui/workspace/workspace.c
index 5adff82..fc2342d 100644
--- a/src/bin/ui/workspace/workspace.c
+++ b/src/bin/ui/workspace/workspace.c
@@ -609,6 +609,7 @@ _mode_cb(void *data,
          evas_object_smart_callback_call(ap.win, SIGNAL_TAB_CHANGED, 
wd->group);
 
          area = &wd->normal;
+         ui_menu_disable_set(ap.menu, MENU_VIEW_WORKSPACE_FIT, false);
          break;
       case MODE_DEMO:
          if (!wd->demo.layout) _scroll_area_add(wd, &wd->demo, false);
@@ -627,6 +628,7 @@ _mode_cb(void *data,
          evas_object_smart_callback_call(ap.win, SIGNAL_DIFFERENT_TAB_CLICKED, 
NULL);
 
          area = &wd->demo;
+         ui_menu_disable_set(ap.menu, MENU_VIEW_WORKSPACE_FIT, true);
          break;
      }
 

-- 


Reply via email to