[gimp] app: disable "Resize windows on zoom/resize" in single-window mode
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: disable "Resize windows on zoom/resize" in single-window mode
- Date: Sun, 10 Jan 2016 19:10:38 +0000 (UTC)
commit 83fbd31f12c9ac24b7b68fdd8ebd364059b71fdb
Author: Michael Natterer <mitch gimp org>
Date: Sun Jan 10 20:09:28 2016 +0100
app: disable "Resize windows on zoom/resize" in single-window mode
They only make sense if the image is by itself in multi-window mode.
app/config/gimprc-blurbs.h | 6 ++++--
app/display/gimpdisplayshell-handlers.c | 23 ++++++++++++++++++-----
app/display/gimpdisplayshell-scale.c | 22 +++++++++++++++++-----
app/tools/gimpmagnifytool.c | 13 ++++++++++---
4 files changed, 49 insertions(+), 15 deletions(-)
---
diff --git a/app/config/gimprc-blurbs.h b/app/config/gimprc-blurbs.h
index fd51d9f..e4ae186 100644
--- a/app/config/gimprc-blurbs.h
+++ b/app/config/gimprc-blurbs.h
@@ -293,11 +293,13 @@ _("Sets the default quick mask color.")
#define RESIZE_WINDOWS_ON_RESIZE_BLURB \
_("When enabled, the image window will automatically resize itself " \
- "whenever the physical image size changes.")
+ "whenever the physical image size changes. This setting only takes " \
+ "effect in multi-window mode.")
#define RESIZE_WINDOWS_ON_ZOOM_BLURB \
_("When enabled, the image window will automatically resize itself " \
- "when zooming into and out of images.")
+ "when zooming into and out of images. This setting only takes " \
+ "effect in multi-window mode.")
#define RESTORE_SESSION_BLURB \
_("Let GIMP try to restore your last saved session on each startup.")
diff --git a/app/display/gimpdisplayshell-handlers.c b/app/display/gimpdisplayshell-handlers.c
index 62be4d5..c828de4 100644
--- a/app/display/gimpdisplayshell-handlers.c
+++ b/app/display/gimpdisplayshell-handlers.c
@@ -27,8 +27,8 @@
#include "display-types.h"
-#include "config/gimpdisplayconfig.h"
#include "config/gimpdisplayoptions.h"
+#include "config/gimpguiconfig.h"
#include "core/gimp.h"
#include "core/gimpguide.h"
@@ -580,9 +580,15 @@ gimp_display_shell_resolution_changed_handler (GimpImage *image,
* a display shell point of view. Force a redraw of the display
* so that we don't get any display garbage.
*/
- gimp_display_shell_scale_resize (shell,
- shell->display->config->resize_windows_on_resize,
- FALSE);
+
+ GimpDisplayConfig *config = shell->display->config;
+ gboolean resize_window;
+
+ /* Resize windows only in multi-window mode */
+ resize_window = (config->resize_windows_on_resize &&
+ ! GIMP_GUI_CONFIG (config)->single_window_mode);
+
+ gimp_display_shell_scale_resize (shell, resize_window, FALSE);
}
}
@@ -744,7 +750,14 @@ gimp_display_shell_size_changed_detailed_handler (GimpImage *image,
gint previous_height,
GimpDisplayShell *shell)
{
- if (shell->display->config->resize_windows_on_resize)
+ GimpDisplayConfig *config = shell->display->config;
+ gboolean resize_window;
+
+ /* Resize windows only in multi-window mode */
+ resize_window = (config->resize_windows_on_resize &&
+ ! GIMP_GUI_CONFIG (config)->single_window_mode);
+
+ if (resize_window)
{
GimpImageWindow *window = gimp_display_shell_get_window (shell);
diff --git a/app/display/gimpdisplayshell-scale.c b/app/display/gimpdisplayshell-scale.c
index 6500e22..d8b2108 100644
--- a/app/display/gimpdisplayshell-scale.c
+++ b/app/display/gimpdisplayshell-scale.c
@@ -26,7 +26,7 @@
#include "display-types.h"
-#include "config/gimpdisplayconfig.h"
+#include "config/gimpguiconfig.h"
#include "core/gimp.h"
#include "core/gimpimage.h"
@@ -183,6 +183,13 @@ gimp_display_shell_scale_set_dot_for_dot (GimpDisplayShell *shell,
if (dot_for_dot != shell->dot_for_dot)
{
+ GimpDisplayConfig *config = shell->display->config;
+ gboolean resize_window;
+
+ /* Resize windows only in multi-window mode */
+ resize_window = (config->resize_windows_on_zoom &&
+ ! GIMP_GUI_CONFIG (config)->single_window_mode);
+
/* freeze the active tool */
gimp_display_shell_pause (shell);
@@ -190,9 +197,7 @@ gimp_display_shell_scale_set_dot_for_dot (GimpDisplayShell *shell,
gimp_display_shell_scale_update (shell);
- gimp_display_shell_scale_resize (shell,
- shell->display->config->resize_windows_on_zoom,
- FALSE);
+ gimp_display_shell_scale_resize (shell, resize_window, FALSE);
/* re-enable the active tool */
gimp_display_shell_resume (shell);
@@ -309,7 +314,14 @@ gimp_display_shell_scale (GimpDisplayShell *shell,
if (! SCALE_EQUALS (new_scale, current_scale))
{
- if (shell->display->config->resize_windows_on_zoom)
+ GimpDisplayConfig *config = shell->display->config;
+ gboolean resize_window;
+
+ /* Resize windows only in multi-window mode */
+ resize_window = (config->resize_windows_on_zoom &&
+ ! GIMP_GUI_CONFIG (config)->single_window_mode);
+
+ if (resize_window)
{
GimpImageWindow *window = gimp_display_shell_get_window (shell);
diff --git a/app/tools/gimpmagnifytool.c b/app/tools/gimpmagnifytool.c
index 48b3dbb..056b60e 100644
--- a/app/tools/gimpmagnifytool.c
+++ b/app/tools/gimpmagnifytool.c
@@ -25,6 +25,8 @@
#include "tools-types.h"
+#include "config/gimpguiconfig.h"
+
#include "core/gimpimage.h"
#include "widgets/gimphelp-ids.h"
@@ -183,18 +185,23 @@ gimp_magnify_tool_button_release (GimpTool *tool,
case GIMP_BUTTON_RELEASE_NORMAL:
{
- gdouble x, y;
- gdouble width, height;
+ gdouble x, y;
+ gdouble width, height;
+ gboolean resize_window;
x = (magnify->w < 0) ? magnify->x + magnify->w : magnify->x;
y = (magnify->h < 0) ? magnify->y + magnify->h : magnify->y;
width = (magnify->w < 0) ? -magnify->w : magnify->w;
height = (magnify->h < 0) ? -magnify->h : magnify->h;
+ /* Resize windows only in multi-window mode */
+ resize_window = (options->auto_resize &&
+ ! GIMP_GUI_CONFIG (display->config)->single_window_mode);
+
gimp_display_shell_scale_to_rectangle (shell,
options->zoom_type,
x, y, width, height,
- options->auto_resize);
+ resize_window);
}
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]