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,
"view-padding-color-in-show-all",
keep);
g_object_notify (G_OBJECT (shell), "infinite-canvas");
}
}

View File

@ -103,7 +103,7 @@ enum
PROP_TITLE,
PROP_STATUS,
PROP_ICON,
PROP_SHOW_ALL
PROP_INFINITE_CANVAS
};
enum
@ -308,11 +308,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_rc_parse_string (display_rc_style);
}
@ -926,9 +926,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);
@ -970,8 +967,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:
@ -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,
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,
GimpNavigationEditor *editor);
static void gimp_navigation_editor_shell_scaled (GimpDisplayShell *shell,
@ -497,7 +497,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,
@ -545,8 +545,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),
@ -721,7 +721,7 @@ gimp_navigation_editor_zoom_adj_changed (GtkAdjustment *adj,
}
static void
gimp_navigation_editor_shell_show_all_notify (GimpDisplayShell *shell,
gimp_navigation_editor_shell_infinite_canvas_notify (GimpDisplayShell *shell,
const GParamSpec *pspec,
GimpNavigationEditor *editor)
{
@ -860,7 +860,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));
@ -882,7 +882,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));
}