mirror of https://github.com/GNOME/gimp.git
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:
parent
c806eae446
commit
e3813131b7
11
ChangeLog
11
ChangeLog
|
@ -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.
|
||||
|
|
|
@ -1967,8 +1967,8 @@ 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,
|
||||
|
|
|
@ -188,7 +188,10 @@ 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",
|
||||
/* 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);
|
||||
|
||||
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue