app: add new action "view-scroll-center" with shortcut Shift+J
The zoom focus discussion on IRC suggests that everybody is annoyed about centering behavior (or lack thereof), so here is a way to explicitly center the image witout zooming.
This commit is contained in:
2
NEWS
2
NEWS
@ -46,6 +46,8 @@ Usability:
|
|||||||
- Improve mouse wheel zooming behavior to keep the same point
|
- Improve mouse wheel zooming behavior to keep the same point
|
||||||
centered under the pointer even if the image is completely visible
|
centered under the pointer even if the image is completely visible
|
||||||
in the canvas.
|
in the canvas.
|
||||||
|
- Add "View -> Center Image in Window" (Shift+J) as a quick way to
|
||||||
|
center the image at any zoom level.
|
||||||
|
|
||||||
Translations:
|
Translations:
|
||||||
|
|
||||||
|
@ -97,6 +97,12 @@ static const GimpActionEntry view_actions[] =
|
|||||||
G_CALLBACK (view_close_cmd_callback),
|
G_CALLBACK (view_close_cmd_callback),
|
||||||
GIMP_HELP_FILE_CLOSE },
|
GIMP_HELP_FILE_CLOSE },
|
||||||
|
|
||||||
|
{ "view-scroll-center", GIMP_ICON_CENTER,
|
||||||
|
NC_("view-action", "Center Image in Window"), "<shift>J",
|
||||||
|
NC_("view-action", "Scroll the image so that it is centered in the window"),
|
||||||
|
G_CALLBACK (view_scroll_center_cmd_callback),
|
||||||
|
GIMP_HELP_VIEW_SCROLL_CENTER },
|
||||||
|
|
||||||
{ "view-zoom-fit-in", GIMP_ICON_ZOOM_FIT_BEST,
|
{ "view-zoom-fit-in", GIMP_ICON_ZOOM_FIT_BEST,
|
||||||
NC_("view-action", "_Fit Image in Window"), "<primary><shift>J",
|
NC_("view-action", "_Fit Image in Window"), "<primary><shift>J",
|
||||||
NC_("view-action", "Adjust the zoom ratio so that the image becomes fully visible"),
|
NC_("view-action", "Adjust the zoom ratio so that the image becomes fully visible"),
|
||||||
@ -897,6 +903,8 @@ view_actions_update (GimpActionGroup *group,
|
|||||||
SET_SENSITIVE ("view-dot-for-dot", image);
|
SET_SENSITIVE ("view-dot-for-dot", image);
|
||||||
SET_ACTIVE ("view-dot-for-dot", display && shell->dot_for_dot);
|
SET_ACTIVE ("view-dot-for-dot", display && shell->dot_for_dot);
|
||||||
|
|
||||||
|
SET_SENSITIVE ("view-scroll-center", image);
|
||||||
|
|
||||||
SET_SENSITIVE ("view-zoom-revert", revert_enabled);
|
SET_SENSITIVE ("view-zoom-revert", revert_enabled);
|
||||||
if (revert_enabled)
|
if (revert_enabled)
|
||||||
{
|
{
|
||||||
|
@ -125,6 +125,17 @@ view_close_cmd_callback (GtkAction *action,
|
|||||||
gimp_display_shell_close (shell, FALSE);
|
gimp_display_shell_close (shell, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
view_scroll_center_cmd_callback (GtkAction *action,
|
||||||
|
gpointer data)
|
||||||
|
{
|
||||||
|
GimpDisplay *display;
|
||||||
|
return_if_no_display (display, data);
|
||||||
|
|
||||||
|
gimp_display_shell_scroll_center_image (gimp_display_get_shell (display),
|
||||||
|
TRUE, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
view_zoom_fit_in_cmd_callback (GtkAction *action,
|
view_zoom_fit_in_cmd_callback (GtkAction *action,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
|
@ -24,6 +24,9 @@ void view_new_cmd_callback (GtkAction *action,
|
|||||||
void view_close_cmd_callback (GtkAction *action,
|
void view_close_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
|
|
||||||
|
void view_scroll_center_cmd_callback (GtkAction *action,
|
||||||
|
gpointer data);
|
||||||
|
|
||||||
void view_zoom_fit_in_cmd_callback (GtkAction *action,
|
void view_zoom_fit_in_cmd_callback (GtkAction *action,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
void view_zoom_fill_cmd_callback (GtkAction *action,
|
void view_zoom_fill_cmd_callback (GtkAction *action,
|
||||||
|
@ -85,6 +85,7 @@
|
|||||||
|
|
||||||
#define GIMP_HELP_VIEW_NEW "gimp-view-new"
|
#define GIMP_HELP_VIEW_NEW "gimp-view-new"
|
||||||
#define GIMP_HELP_VIEW_DOT_FOR_DOT "gimp-view-dot-for-dot"
|
#define GIMP_HELP_VIEW_DOT_FOR_DOT "gimp-view-dot-for-dot"
|
||||||
|
#define GIMP_HELP_VIEW_SCROLL_CENTER "gimp-view-scroll-center"
|
||||||
#define GIMP_HELP_VIEW_ZOOM_REVERT "gimp-view-zoom-revert"
|
#define GIMP_HELP_VIEW_ZOOM_REVERT "gimp-view-zoom-revert"
|
||||||
#define GIMP_HELP_VIEW_ZOOM_OUT "gimp-view-zoom-out"
|
#define GIMP_HELP_VIEW_ZOOM_OUT "gimp-view-zoom-out"
|
||||||
#define GIMP_HELP_VIEW_ZOOM_IN "gimp-view-zoom-in"
|
#define GIMP_HELP_VIEW_ZOOM_IN "gimp-view-zoom-in"
|
||||||
|
@ -294,6 +294,7 @@
|
|||||||
<separator />
|
<separator />
|
||||||
<menuitem action="view-rotate-other" />
|
<menuitem action="view-rotate-other" />
|
||||||
</menu>
|
</menu>
|
||||||
|
<menuitem action="view-scroll-center" />
|
||||||
<separator />
|
<separator />
|
||||||
<menuitem action="view-shrink-wrap" />
|
<menuitem action="view-shrink-wrap" />
|
||||||
<menuitem action="view-fullscreen" />
|
<menuitem action="view-fullscreen" />
|
||||||
|
Reference in New Issue
Block a user