also use the middle mouse button for panning.

2007-04-25  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimpscrolledpreview.c: also use the middle mouse
	button for panning.

	* plug-ins/common/nova.c: override the default mouse handling of
	the GimpScrolledPreview and allow to reposition the center using
	the left mouse button. Fixes bug #364432.

	* app/tools/gimprectangletool.c: formatting.

svn path=/trunk/; revision=22319
This commit is contained in:
Sven Neumann 2007-04-25 10:10:43 +00:00 committed by Sven Neumann
parent c806eae446
commit e3813131b7
4 changed files with 42 additions and 21 deletions

View File

@ -1,3 +1,14 @@
2007-04-25 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimpscrolledpreview.c: also use the middle mouse
button for panning.
* plug-ins/common/nova.c: override the default mouse handling of
the GimpScrolledPreview and allow to reposition the center using
the left mouse button. Fixes bug #364432.
* app/tools/gimprectangletool.c: formatting.
2007-04-24 Sven Neumann <sven@gimp.org>
* configure.in: bumped version to 2.3.17.

View File

@ -1967,15 +1967,15 @@ gimp_rectangle_tool_rectangle_changed (GimpRectangleTool *rectangle)
/*
* check whether the coordinates extend outside the bounds of the image
* or active drawable, if it is constrained not to. If it does,truncates
* the corrners to the constraints.
* or active drawable, if it is constrained not to. If it does, clamp
* the corners to the constraints.
*/
void
gimp_rectangle_tool_constrain (GimpRectangleTool *rectangle,
gint *x1,
gint *y1,
gint *x2,
gint *y2)
gint *x1,
gint *y1,
gint *x2,
gint *y2)
{
GimpTool *tool = GIMP_TOOL (rectangle);
GimpRectangleToolPrivate *private;

View File

@ -32,8 +32,8 @@
#include "libgimp/libgimp-intl.h"
#define POPUP_SIZE 100
#define PEN_WIDTH 3
#define POPUP_SIZE 100
#define PEN_WIDTH 3
typedef struct
@ -129,9 +129,9 @@ gimp_scrolled_preview_class_init (GimpScrolledPreviewClass *klass)
parent_class = g_type_class_peek_parent (klass);
object_class->dispose = gimp_scrolled_preview_dispose;
object_class->dispose = gimp_scrolled_preview_dispose;
preview_class->set_cursor = gimp_scrolled_preview_set_cursor;
preview_class->set_cursor = gimp_scrolled_preview_set_cursor;
g_type_class_add_private (object_class, sizeof (GimpScrolledPreviewPrivate));
}
@ -188,9 +188,12 @@ gimp_scrolled_preview_init (GimpScrolledPreview *preview)
preview->vscr, 1, 2, 0, 1,
GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
g_signal_connect (GIMP_PREVIEW (preview)->area, "event",
G_CALLBACK (gimp_scrolled_preview_area_event),
preview);
/* Connect after here so that plug-ins get a chance to override the
* default behavior. See bug #364432.
*/
g_signal_connect_after (GIMP_PREVIEW (preview)->area, "event",
G_CALLBACK (gimp_scrolled_preview_area_event),
preview);
g_signal_connect (GIMP_PREVIEW (preview)->area, "realize",
G_CALLBACK (gimp_scrolled_preview_area_realize),
@ -374,6 +377,7 @@ gimp_scrolled_preview_area_event (GtkWidget *area,
switch (button_event->button)
{
case 1:
case 2:
gtk_widget_get_pointer (area, &priv->drag_x, &priv->drag_y);
priv->drag_xoff = GIMP_PREVIEW (preview)->xoff;
@ -382,16 +386,14 @@ gimp_scrolled_preview_area_event (GtkWidget *area,
gtk_grab_add (area);
break;
case 2:
break;
case 3:
return TRUE;
}
break;
case GDK_BUTTON_RELEASE:
if (priv->in_drag && button_event->button == 1)
if (priv->in_drag &&
(button_event->button == 1 || button_event->button == 2))
{
gtk_grab_remove (area);
priv->in_drag = FALSE;

View File

@ -324,7 +324,8 @@ nova_dialog (GimpDrawable *drawable)
preview = gimp_zoom_preview_new (drawable);
gtk_widget_add_events (GIMP_PREVIEW (preview)->area,
GDK_POINTER_MOTION_MASK);
GDK_BUTTON_PRESS_MASK |
GDK_BUTTON1_MOTION_MASK);
gtk_box_pack_start (GTK_BOX (main_vbox), preview, TRUE, TRUE, 0);
gtk_widget_show (preview);
@ -657,8 +658,15 @@ nova_center_preview_events (GtkWidget *widget,
{
GdkEventMotion *mevent = (GdkEventMotion *) event;
if (mevent->state & GDK_BUTTON2_MASK)
return nova_center_update (widget, center, mevent->x, mevent->y);
if (mevent->state & GDK_BUTTON1_MASK)
{
GdkModifierType mask;
gint x, y;
gdk_window_get_pointer (widget->window, &x, &y, &mask);
return nova_center_update (widget, center, x, y);
}
}
break;
@ -666,7 +674,7 @@ nova_center_preview_events (GtkWidget *widget,
{
GdkEventButton *bevent = (GdkEventButton *) event;
if (bevent->button == 2)
if (bevent->button == 1)
return nova_center_update (widget, center, bevent->x, bevent->y);
}
break;