[gimp] app: behave as if "show all" is disabled in the navigation dockable when keeping padding



commit c9fc2862f8dbe3504283e590400b87d0b07fdd34
Author: Ell <ell_se yahoo com>
Date:   Sun Sep 15 16:27:17 2019 +0300

    app: behave as if "show all" is disabled in the navigation dockable when keeping padding

 app/display/gimpdisplayshell-appearance.c |   2 +
 app/display/gimpdisplayshell.c            |  18 ++---
 app/display/gimpnavigationeditor.c        | 121 +++++++++++++++---------------
 3 files changed, 71 insertions(+), 70 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-appearance.c b/app/display/gimpdisplayshell-appearance.c
index 6952f7bfe4..f3c6bf1bd6 100644
--- a/app/display/gimpdisplayshell-appearance.c
+++ b/app/display/gimpdisplayshell-appearance.c
@@ -553,6 +553,8 @@ gimp_display_shell_set_padding_in_show_all (GimpDisplayShell *shell,
       gimp_display_shell_set_action_active (shell,
                                             "view-padding-color-in-show-all",
                                             keep);
+
+      g_object_notify (G_OBJECT (shell), "infinite-canvas");
     }
 }
 
diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c
index 7128562b04..f94c6ab356 100644
--- a/app/display/gimpdisplayshell.c
+++ b/app/display/gimpdisplayshell.c
@@ -105,7 +105,7 @@ enum
   PROP_TITLE,
   PROP_STATUS,
   PROP_ICON,
-  PROP_SHOW_ALL
+  PROP_INFINITE_CANVAS
 };
 
 enum
@@ -295,11 +295,11 @@ gimp_display_shell_class_init (GimpDisplayShellClass *klass)
                                                         GDK_TYPE_PIXBUF,
                                                         GIMP_PARAM_READWRITE));
 
-  g_object_class_install_property (object_class, PROP_SHOW_ALL,
-                                   g_param_spec_boolean ("show-all",
+  g_object_class_install_property (object_class, PROP_INFINITE_CANVAS,
+                                   g_param_spec_boolean ("infinite-canvas",
                                                          NULL, NULL,
                                                          FALSE,
-                                                         GIMP_PARAM_READWRITE));
+                                                         GIMP_PARAM_READABLE));
 
   gtk_widget_class_set_css_name (widget_class, "GimpDisplayShell");
 }
@@ -854,9 +854,6 @@ gimp_display_shell_set_property (GObject      *object,
         g_object_unref (shell->icon);
       shell->icon = g_value_dup_object (value);
       break;
-    case PROP_SHOW_ALL:
-      gimp_display_shell_set_show_all (shell, g_value_get_boolean (value));
-      break;
 
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -895,8 +892,9 @@ gimp_display_shell_get_property (GObject    *object,
     case PROP_ICON:
       g_value_set_object (value, shell->icon);
       break;
-    case PROP_SHOW_ALL:
-      g_value_set_boolean (value, shell->show_all);
+    case PROP_INFINITE_CANVAS:
+      g_value_set_boolean (value,
+                           gimp_display_shell_get_infinite_canvas (shell));
       break;
 
     default:
@@ -1794,7 +1792,7 @@ gimp_display_shell_set_show_all (GimpDisplayShell *shell,
             }
         }
 
-      g_object_notify (G_OBJECT (shell), "show-all");
+      g_object_notify (G_OBJECT (shell), "infinite-canvas");
     }
 }
 
diff --git a/app/display/gimpnavigationeditor.c b/app/display/gimpnavigationeditor.c
index 7b39127424..28f7407e28 100644
--- a/app/display/gimpnavigationeditor.c
+++ b/app/display/gimpnavigationeditor.c
@@ -59,58 +59,58 @@
 #define UPDATE_DELAY 300 /* From GtkRange in GTK+ 2.22 */
 
 
-static void        gimp_navigation_editor_docked_iface_init          (GimpDockedInterface  *iface);
-
-static void        gimp_navigation_editor_dispose                    (GObject              *object);
-
-static void        gimp_navigation_editor_set_context                (GimpDocked           *docked,
-                                                                      GimpContext          *context);
-
-static GtkWidget * gimp_navigation_editor_new_private                (GimpMenuFactory      *menu_factory,
-                                                                      GimpDisplayShell     *shell);
-
-static void        gimp_navigation_editor_set_shell                  (GimpNavigationEditor *editor,
-                                                                      GimpDisplayShell     *shell);
-static gboolean    gimp_navigation_editor_button_release             (GtkWidget            *widget,
-                                                                      GdkEventButton       *bevent,
-                                                                      GimpDisplayShell     *shell);
-static void        gimp_navigation_editor_marker_changed             (GimpNavigationView   *view,
-                                                                      gdouble               center_x,
-                                                                      gdouble               center_y,
-                                                                      gdouble               width,
-                                                                      gdouble               height,
-                                                                      GimpNavigationEditor *editor);
-static void        gimp_navigation_editor_zoom                       (GimpNavigationView   *view,
-                                                                      GimpZoomType          direction,
-                                                                      gdouble               delta,
-                                                                      GimpNavigationEditor *editor);
-static void        gimp_navigation_editor_scroll                     (GimpNavigationView   *view,
-                                                                      GdkEventScroll       *sevent,
-                                                                      GimpNavigationEditor *editor);
-
-static void        gimp_navigation_editor_zoom_adj_changed           (GtkAdjustment        *adj,
-                                                                      GimpNavigationEditor *editor);
-
-static void        gimp_navigation_editor_shell_show_all_notify      (GimpDisplayShell     *shell,
-                                                                      const GParamSpec     *pspec,
-                                                                      GimpNavigationEditor *editor);
-static void        gimp_navigation_editor_shell_scaled               (GimpDisplayShell     *shell,
-                                                                      GimpNavigationEditor *editor);
-static void        gimp_navigation_editor_shell_scrolled             (GimpDisplayShell     *shell,
-                                                                      GimpNavigationEditor *editor);
-static void        gimp_navigation_editor_shell_rotated              (GimpDisplayShell     *shell,
-                                                                      GimpNavigationEditor *editor);
-static void        gimp_navigation_editor_shell_reconnect            (GimpDisplayShell     *shell,
-                                                                      GimpNavigationEditor *editor);
-
-static void        gimp_navigation_editor_viewable_size_changed      (GimpViewable         *viewable,
-                                                                      GimpNavigationEditor *editor);
-
-static void        gimp_navigation_editor_options_show_canvas_notify (GimpDisplayOptions   *options,
-                                                                      const GParamSpec     *pspec,
-                                                                      GimpNavigationEditor *editor);
-
-static void        gimp_navigation_editor_update_marker              (GimpNavigationEditor *editor);
+static void        gimp_navigation_editor_docked_iface_init            (GimpDockedInterface  *iface);
+
+static void        gimp_navigation_editor_dispose                      (GObject              *object);
+
+static void        gimp_navigation_editor_set_context                  (GimpDocked           *docked,
+                                                                        GimpContext          *context);
+
+static GtkWidget * gimp_navigation_editor_new_private                  (GimpMenuFactory      *menu_factory,
+                                                                        GimpDisplayShell     *shell);
+
+static void        gimp_navigation_editor_set_shell                    (GimpNavigationEditor *editor,
+                                                                        GimpDisplayShell     *shell);
+static gboolean    gimp_navigation_editor_button_release               (GtkWidget            *widget,
+                                                                        GdkEventButton       *bevent,
+                                                                        GimpDisplayShell     *shell);
+static void        gimp_navigation_editor_marker_changed               (GimpNavigationView   *view,
+                                                                        gdouble               center_x,
+                                                                        gdouble               center_y,
+                                                                        gdouble               width,
+                                                                        gdouble               height,
+                                                                        GimpNavigationEditor *editor);
+static void        gimp_navigation_editor_zoom                         (GimpNavigationView   *view,
+                                                                        GimpZoomType          direction,
+                                                                        gdouble               delta,
+                                                                        GimpNavigationEditor *editor);
+static void        gimp_navigation_editor_scroll                       (GimpNavigationView   *view,
+                                                                        GdkEventScroll       *sevent,
+                                                                        GimpNavigationEditor *editor);
+
+static void        gimp_navigation_editor_zoom_adj_changed             (GtkAdjustment        *adj,
+                                                                        GimpNavigationEditor *editor);
+
+static void        gimp_navigation_editor_shell_infinite_canvas_notify (GimpDisplayShell     *shell,
+                                                                        const GParamSpec     *pspec,
+                                                                        GimpNavigationEditor *editor);
+static void        gimp_navigation_editor_shell_scaled                 (GimpDisplayShell     *shell,
+                                                                        GimpNavigationEditor *editor);
+static void        gimp_navigation_editor_shell_scrolled               (GimpDisplayShell     *shell,
+                                                                        GimpNavigationEditor *editor);
+static void        gimp_navigation_editor_shell_rotated                (GimpDisplayShell     *shell,
+                                                                        GimpNavigationEditor *editor);
+static void        gimp_navigation_editor_shell_reconnect              (GimpDisplayShell     *shell,
+                                                                        GimpNavigationEditor *editor);
+
+static void        gimp_navigation_editor_viewable_size_changed        (GimpViewable         *viewable,
+                                                                        GimpNavigationEditor *editor);
+
+static void        gimp_navigation_editor_options_show_canvas_notify   (GimpDisplayOptions   *options,
+                                                                        const GParamSpec     *pspec,
+                                                                        GimpNavigationEditor *editor);
+
+static void        gimp_navigation_editor_update_marker                (GimpNavigationEditor *editor);
 
 
 G_DEFINE_TYPE_WITH_CODE (GimpNavigationEditor, gimp_navigation_editor,
@@ -507,7 +507,7 @@ gimp_navigation_editor_set_shell (GimpNavigationEditor *editor,
   if (editor->shell)
     {
       g_signal_handlers_disconnect_by_func (editor->shell,
-                                            gimp_navigation_editor_shell_show_all_notify,
+                                            gimp_navigation_editor_shell_infinite_canvas_notify,
                                             editor);
       g_signal_handlers_disconnect_by_func (editor->shell,
                                             gimp_navigation_editor_shell_scaled,
@@ -555,8 +555,8 @@ gimp_navigation_editor_set_shell (GimpNavigationEditor *editor,
       gimp_view_set_viewable (GIMP_VIEW (editor->view),
                               GIMP_VIEWABLE (editor->image_viewable));
 
-      g_signal_connect (editor->shell, "notify::show-all",
-                        G_CALLBACK (gimp_navigation_editor_shell_show_all_notify),
+      g_signal_connect (editor->shell, "notify::infinite-canvas",
+                        G_CALLBACK (gimp_navigation_editor_shell_infinite_canvas_notify),
                         editor);
       g_signal_connect (editor->shell, "scaled",
                         G_CALLBACK (gimp_navigation_editor_shell_scaled),
@@ -703,9 +703,9 @@ gimp_navigation_editor_zoom_adj_changed (GtkAdjustment        *adj,
 }
 
 static void
-gimp_navigation_editor_shell_show_all_notify (GimpDisplayShell     *shell,
-                                              const GParamSpec     *pspec,
-                                              GimpNavigationEditor *editor)
+gimp_navigation_editor_shell_infinite_canvas_notify (GimpDisplayShell     *shell,
+                                                     const GParamSpec     *pspec,
+                                                     GimpNavigationEditor *editor)
 {
   gimp_navigation_editor_update_marker (editor);
 
@@ -842,7 +842,7 @@ gimp_navigation_editor_update_marker (GimpNavigationEditor *editor)
 
       gimp_image_viewable_set_show_all (
         GIMP_IMAGE_VIEWABLE (renderer->viewable),
-        shell->show_all);
+        gimp_display_shell_get_infinite_canvas (shell));
 
       bounding_box = gimp_image_viewable_get_bounding_box (
         GIMP_IMAGE_VIEWABLE (renderer->viewable));
@@ -864,7 +864,8 @@ gimp_navigation_editor_update_marker (GimpNavigationEditor *editor)
 
       gimp_navigation_view_set_canvas (
         view,
-        shell->show_all && gimp_display_shell_get_show_canvas (shell),
+        gimp_display_shell_get_infinite_canvas (shell) &&
+        gimp_display_shell_get_show_canvas (shell),
         -bounding_box.x,              -bounding_box.y,
         gimp_image_get_width (image), gimp_image_get_height (image));
     }


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