[nautilus/wip/gaction: 6/19] nautilus-desktop-view: drop stretch icons



commit 4c7f46bc92c6f7f57f7ffe372903f8a02ad87d7c
Author: Carlos Soriano <carlos sorian89 gmail com>
Date:   Mon Jan 12 17:56:00 2015 +0100

    nautilus-desktop-view: drop stretch icons
    
    This action was not working very nice, and the desktop supports zoom
    setting. So having an icon bigger than the others ones seems undesirable.
    Drop this item.

 src/nautilus-actions.h                  |    2 -
 src/nautilus-canvas-view.c              |    7 ---
 src/nautilus-desktop-canvas-view-ui.xml |    2 -
 src/nautilus-desktop-canvas-view.c      |   71 -------------------------------
 4 files changed, 0 insertions(+), 82 deletions(-)
---
diff --git a/src/nautilus-actions.h b/src/nautilus-actions.h
index c5d5a68..5bf0f29 100644
--- a/src/nautilus-actions.h
+++ b/src/nautilus-actions.h
@@ -118,8 +118,6 @@
 #define NAUTILUS_ACTION_CLEAN_UP "Clean Up"
 #define NAUTILUS_ACTION_KEEP_ALIGNED "Keep Aligned"
 #define NAUTILUS_ACTION_ARRANGE_ITEMS "Arrange Items"
-#define NAUTILUS_ACTION_STRETCH "Stretch"
-#define NAUTILUS_ACTION_UNSTRETCH "Unstretch"
 #define NAUTILUS_ACTION_ZOOM_ITEMS "Zoom Items"
 #define NAUTILUS_ACTION_SORT_TRASH_TIME "Sort by Trash Time"
 #define NAUTILUS_ACTION_SORT_SEARCH_RELEVANCE "Sort by Search Relevance"
diff --git a/src/nautilus-canvas-view.c b/src/nautilus-canvas-view.c
index b262269..ac29b6a 100644
--- a/src/nautilus-canvas-view.c
+++ b/src/nautilus-canvas-view.c
@@ -1866,13 +1866,6 @@ create_canvas_container (NautilusCanvasView *canvas_view)
                                 G_CALLBACK (icon_rename_started_cb), canvas_view, 0);
        g_signal_connect_object (canvas_container, "icon-rename-ended",
                                 G_CALLBACK (icon_rename_ended_cb), canvas_view, 0);
-       g_signal_connect_object (canvas_container, "icon-stretch-started",
-                                G_CALLBACK (nautilus_view_update_menus), canvas_view,
-                                G_CONNECT_SWAPPED);
-       g_signal_connect_object (canvas_container, "icon-stretch-ended",
-                                G_CALLBACK (nautilus_view_update_menus), canvas_view,
-                                G_CONNECT_SWAPPED);
-
        g_signal_connect_object (canvas_container, "get-stored-layout-timestamp",
                                 G_CALLBACK (get_stored_layout_timestamp), canvas_view, 0);
        g_signal_connect_object (canvas_container, "store-layout-timestamp",
diff --git a/src/nautilus-desktop-canvas-view-ui.xml b/src/nautilus-desktop-canvas-view-ui.xml
index 8d631ee..560142b 100644
--- a/src/nautilus-desktop-canvas-view-ui.xml
+++ b/src/nautilus-desktop-canvas-view-ui.xml
@@ -21,8 +21,6 @@
     <menuitem name="Empty Trash" action="Empty Trash Conditional"/>
   </placeholder>
   <placeholder name="Canvas Appearance Items">
-    <menuitem name="Stretch" action="Stretch"/>
-    <menuitem name="Unstretch" action="Unstretch"/>
   </placeholder>
 </popup>
 </ui>
diff --git a/src/nautilus-desktop-canvas-view.c b/src/nautilus-desktop-canvas-view.c
index fa03309..dd61c9c 100644
--- a/src/nautilus-desktop-canvas-view.c
+++ b/src/nautilus-desktop-canvas-view.c
@@ -592,21 +592,6 @@ action_empty_trash_conditional_callback (GtkAction *action,
 }
 
 static void
-action_stretch_callback (GtkAction *action,
-                        gpointer callback_data)
-{
-       nautilus_canvas_container_show_stretch_handles
-               (get_canvas_container (callback_data));
-}
-
-static void
-action_unstretch_callback (GtkAction *action,
-                          gpointer callback_data)
-{
-       nautilus_canvas_container_unstretch (get_canvas_container (callback_data));
-}
-
-static void
 action_clean_up_callback (GtkAction *action,
                          gpointer callback_data)
 {
@@ -646,11 +631,9 @@ static void
 real_update_menus (NautilusView *view)
 {
        NautilusDesktopCanvasView *desktop_view;
-        NautilusCanvasContainer *canvas_container;
        gboolean include_empty_trash;
        char *label;
        GtkAction *action;
-        int selection_count;
 
        g_assert (NAUTILUS_IS_DESKTOP_CANVAS_VIEW (view));
 
@@ -671,31 +654,6 @@ real_update_menus (NautilusView *view)
                                          !nautilus_trash_monitor_is_empty ());
                g_free (label);
        }
-
-       /* Stretch */
-        selection_count = nautilus_view_get_selection_count (view);
-        canvas_container = get_canvas_container (desktop_view);
-
-       action = gtk_action_group_get_action (desktop_view->details->desktop_action_group,
-                                             NAUTILUS_ACTION_STRETCH);
-       gtk_action_set_sensitive (action,
-                                 selection_count == 1
-                                 && canvas_container != NULL
-                                 && !nautilus_canvas_container_has_stretch_handles (canvas_container));
-       gtk_action_set_visible (action, TRUE);
-
-       /* Unstretch */
-       action = gtk_action_group_get_action (desktop_view->details->desktop_action_group,
-                                             NAUTILUS_ACTION_UNSTRETCH);
-       g_object_set (action, "label",
-                     (selection_count > 1)
-                     ? _("Restore Icons' Original Si_zes")
-                     : _("Restore Icon's Original Si_ze"),
-                     NULL);
-       gtk_action_set_sensitive (action,
-                                 canvas_container != NULL
-                                 && nautilus_canvas_container_is_stretched (canvas_container));
-       gtk_action_set_visible (action, TRUE);
 }
 
 static const GtkActionEntry desktop_view_entries[] = {
@@ -720,20 +678,6 @@ static const GtkActionEntry desktop_view_entries[] = {
          /* tooltip */
          N_("Reposition icons to better fit in the window and avoid overlapping"),
          G_CALLBACK (action_clean_up_callback) },
-       /* name, stock id */
-         { "Stretch", NULL,
-          /* label, accelerator */
-          N_("Resize Icon…"), NULL,
-          /* tooltip */
-          N_("Make the selected icons resizable"),
-          G_CALLBACK (action_stretch_callback) },
-       /* name, stock id */
-       { "Unstretch", NULL,
-         /* label, accelerator */
-         N_("Restore Icons' Original Si_zes"), NULL,
-         /* tooltip */
-         N_("Restore each selected icon to its original size"),
-         G_CALLBACK (action_unstretch_callback) },
 };
 
 static void
@@ -763,21 +707,6 @@ real_merge_menus (NautilusView *view)
        desktop_view->details->desktop_merge_id =
                gtk_ui_manager_add_ui_from_resource (ui_manager, 
"/org/gnome/nautilus/nautilus-desktop-canvas-view-ui.xml", NULL);
 
-       gtk_ui_manager_add_ui (ui_manager,
-                              desktop_view->details->desktop_merge_id,
-                              POPUP_PATH_CANVAS_APPEARANCE,
-                              NAUTILUS_ACTION_STRETCH,
-                              NAUTILUS_ACTION_STRETCH,
-                              GTK_UI_MANAGER_MENUITEM,
-                              FALSE);
-       gtk_ui_manager_add_ui (ui_manager,
-                              desktop_view->details->desktop_merge_id,
-                              POPUP_PATH_CANVAS_APPEARANCE,
-                              NAUTILUS_ACTION_UNSTRETCH,
-                              NAUTILUS_ACTION_UNSTRETCH,
-                              GTK_UI_MANAGER_MENUITEM,
-                              FALSE);
-
        if (get_control_center_command (NULL) == NULL) {
                action = gtk_action_group_get_action (action_group, NAUTILUS_ACTION_CHANGE_BACKGROUND);
                gtk_action_set_visible (action, FALSE);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]