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

This commit is contained in:
Ell
2019-09-15 16:27:17 +03:00
parent 6088a747c0
commit f5fab1daa6
3 changed files with 61 additions and 60 deletions

View File

@ -573,6 +573,8 @@ gimp_display_shell_set_padding_in_show_all (GimpDisplayShell *shell,
gimp_display_shell_set_action_active (shell, gimp_display_shell_set_action_active (shell,
"view-padding-color-in-show-all", "view-padding-color-in-show-all",
keep); keep);
g_object_notify (G_OBJECT (shell), "infinite-canvas");
} }
} }

View File

@ -103,7 +103,7 @@ enum
PROP_TITLE, PROP_TITLE,
PROP_STATUS, PROP_STATUS,
PROP_ICON, PROP_ICON,
PROP_SHOW_ALL PROP_INFINITE_CANVAS
}; };
enum enum
@ -308,11 +308,11 @@ gimp_display_shell_class_init (GimpDisplayShellClass *klass)
GDK_TYPE_PIXBUF, GDK_TYPE_PIXBUF,
GIMP_PARAM_READWRITE)); GIMP_PARAM_READWRITE));
g_object_class_install_property (object_class, PROP_SHOW_ALL, g_object_class_install_property (object_class, PROP_INFINITE_CANVAS,
g_param_spec_boolean ("show-all", g_param_spec_boolean ("infinite-canvas",
NULL, NULL, NULL, NULL,
FALSE, FALSE,
GIMP_PARAM_READWRITE)); GIMP_PARAM_READABLE));
gtk_rc_parse_string (display_rc_style); gtk_rc_parse_string (display_rc_style);
} }
@ -926,9 +926,6 @@ gimp_display_shell_set_property (GObject *object,
g_object_unref (shell->icon); g_object_unref (shell->icon);
shell->icon = g_value_dup_object (value); shell->icon = g_value_dup_object (value);
break; break;
case PROP_SHOW_ALL:
gimp_display_shell_set_show_all (shell, g_value_get_boolean (value));
break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@ -970,8 +967,9 @@ gimp_display_shell_get_property (GObject *object,
case PROP_ICON: case PROP_ICON:
g_value_set_object (value, shell->icon); g_value_set_object (value, shell->icon);
break; break;
case PROP_SHOW_ALL: case PROP_INFINITE_CANVAS:
g_value_set_boolean (value, shell->show_all); g_value_set_boolean (value,
gimp_display_shell_get_infinite_canvas (shell));
break; break;
default: default:
@ -1850,7 +1848,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");
} }
} }

View File

@ -90,7 +90,7 @@ static void gimp_navigation_editor_scroll (GimpNaviga
static void gimp_navigation_editor_zoom_adj_changed (GtkAdjustment *adj, static void gimp_navigation_editor_zoom_adj_changed (GtkAdjustment *adj,
GimpNavigationEditor *editor); GimpNavigationEditor *editor);
static void gimp_navigation_editor_shell_show_all_notify (GimpDisplayShell *shell, static void gimp_navigation_editor_shell_infinite_canvas_notify (GimpDisplayShell *shell,
const GParamSpec *pspec, const GParamSpec *pspec,
GimpNavigationEditor *editor); GimpNavigationEditor *editor);
static void gimp_navigation_editor_shell_scaled (GimpDisplayShell *shell, static void gimp_navigation_editor_shell_scaled (GimpDisplayShell *shell,
@ -497,7 +497,7 @@ gimp_navigation_editor_set_shell (GimpNavigationEditor *editor,
if (editor->shell) if (editor->shell)
{ {
g_signal_handlers_disconnect_by_func (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); editor);
g_signal_handlers_disconnect_by_func (editor->shell, g_signal_handlers_disconnect_by_func (editor->shell,
gimp_navigation_editor_shell_scaled, gimp_navigation_editor_shell_scaled,
@ -545,8 +545,8 @@ gimp_navigation_editor_set_shell (GimpNavigationEditor *editor,
gimp_view_set_viewable (GIMP_VIEW (editor->view), gimp_view_set_viewable (GIMP_VIEW (editor->view),
GIMP_VIEWABLE (editor->image_viewable)); GIMP_VIEWABLE (editor->image_viewable));
g_signal_connect (editor->shell, "notify::show-all", g_signal_connect (editor->shell, "notify::infinite-canvas",
G_CALLBACK (gimp_navigation_editor_shell_show_all_notify), G_CALLBACK (gimp_navigation_editor_shell_infinite_canvas_notify),
editor); editor);
g_signal_connect (editor->shell, "scaled", g_signal_connect (editor->shell, "scaled",
G_CALLBACK (gimp_navigation_editor_shell_scaled), G_CALLBACK (gimp_navigation_editor_shell_scaled),
@ -721,7 +721,7 @@ gimp_navigation_editor_zoom_adj_changed (GtkAdjustment *adj,
} }
static void static void
gimp_navigation_editor_shell_show_all_notify (GimpDisplayShell *shell, gimp_navigation_editor_shell_infinite_canvas_notify (GimpDisplayShell *shell,
const GParamSpec *pspec, const GParamSpec *pspec,
GimpNavigationEditor *editor) GimpNavigationEditor *editor)
{ {
@ -860,7 +860,7 @@ gimp_navigation_editor_update_marker (GimpNavigationEditor *editor)
gimp_image_viewable_set_show_all ( gimp_image_viewable_set_show_all (
GIMP_IMAGE_VIEWABLE (renderer->viewable), GIMP_IMAGE_VIEWABLE (renderer->viewable),
shell->show_all); gimp_display_shell_get_infinite_canvas (shell));
bounding_box = gimp_image_viewable_get_bounding_box ( bounding_box = gimp_image_viewable_get_bounding_box (
GIMP_IMAGE_VIEWABLE (renderer->viewable)); GIMP_IMAGE_VIEWABLE (renderer->viewable));
@ -882,7 +882,8 @@ gimp_navigation_editor_update_marker (GimpNavigationEditor *editor)
gimp_navigation_view_set_canvas ( gimp_navigation_view_set_canvas (
view, 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, -bounding_box.x, -bounding_box.y,
gimp_image_get_width (image), gimp_image_get_height (image)); gimp_image_get_width (image), gimp_image_get_height (image));
} }