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.
This commit is contained in:
@ -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.")
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user