Commit a08bb85d authored by Emmanuel Pacaud's avatar Emmanuel Pacaud Committed by Emmanuel Pacaud

set snap_to_grid if SHIFT is pressed, state given by widget parent window.

2005-06-22  Emmanuel Pacaud <emmanuel.pacaud@univ-poitiers.fr>

	* src/gnumeric-pane.c (cb_gnm_pane_drag_motion): set snap_to_grid if
	SHIFT is pressed, state given by widget parent window.
	* src/sheet-control-gui.c (scg_drag_receive_same_scg): ditto.
	(scg_objects_nudge): fix typo.
parent f4bd10b8
2005-06-22 Emmanuel Pacaud <emmanuel.pacaud@univ-poitiers.fr>
* src/gnumeric-pane.c (cb_gnm_pane_drag_motion): set snap_to_grid if
SHIFT is pressed, state given by widget parent window.
* src/sheet-control-gui.c (scg_drag_receive_same_scg): ditto.
(scg_objects_nudge): fix typo.
2005-06-14 Jody Goldberg <jody@gnome.org>
http://bugzilla.gnome.org/show_bug.cgi?id=163414
......
2005-06-22 Emmanuel Pacaud <emmanuel.pacaud@univ-poitiers.fr>
* src/gnumeric-pane.c (cb_gnm_pane_drag_motion): set snap_to_grid if
SHIFT is pressed, state given by widget parent window.
* src/sheet-control-gui.c (scg_drag_receive_same_scg): ditto.
(scg_objects_nudge): fix typo.
2005-06-14 Jody Goldberg <jody@gnome.org>
http://bugzilla.gnome.org/show_bug.cgi?id=163414
......
......@@ -236,13 +236,16 @@ cb_gnm_pane_drag_motion (GtkWidget *widget, GdkDragContext *context,
{
GtkWidget *source_widget = gtk_drag_get_source_widget (context);
SheetControlGUI *scg = GNM_CANVAS (widget)->simple.scg;
if ((IS_GNM_CANVAS (source_widget) &&
GNM_CANVAS (source_widget)->simple.scg == scg)) {
/* same scg */
GnmPane *source_pane = GNM_CANVAS (source_widget)->pane;
GnmCanvas *gcanvas = GNM_CANVAS (widget);
GdkWindow *window;
GdkModifierType mask;
double wx, wy;
int xp, yp;
g_object_set_data (&context->parent_instance, "gnm-pane", pane);
if (gcanvas->first.col > 0)
......@@ -254,8 +257,13 @@ cb_gnm_pane_drag_motion (GtkWidget *widget, GdkDragContext *context,
(gcanvas->simple.scg, FALSE, 0,
gcanvas->first.row);
foo_canvas_c2w (FOO_CANVAS (gcanvas), x, y, &wx, &wy);
window = gtk_widget_get_parent_window (widget);
gdk_window_get_pointer (window, &xp, &yp, &mask);
gnm_pane_objects_drag (source_pane, NULL, wx, wy, 8,
FALSE, FALSE);
FALSE,
(mask & GDK_SHIFT_MASK) != 0);
gdk_drag_status (context, GDK_ACTION_MOVE, time);
}
return TRUE;
......@@ -289,7 +297,7 @@ cb_gnm_pane_drag_leave (GtkWidget *widget, GdkDragContext *context,
gnm_pane_objects_drag (source_pane, NULL,
source_pane->drag.origin_x,
source_pane->drag.origin_y,
8, FALSE, FALSE);
8, FALSE, FALSE);
source_pane->drag.had_motion = FALSE;
}
......
......@@ -2146,7 +2146,7 @@ scg_objects_nudge (SheetControlGUI *scg, GnmCanvas *gcanvas,
int drag_type, double dx, double dy, gboolean symmetric, gboolean snap_to_grid)
{
/* no nudging if we are creating an object */
if (scg->new_object) {
if (!scg->new_object) {
scg_objects_drag (scg, gcanvas, NULL, &dx, &dy, drag_type, symmetric, snap_to_grid, FALSE);
scg_objects_drag_commit (scg, drag_type, FALSE);
}
......@@ -3160,7 +3160,15 @@ static void
scg_drag_receive_same_scg (SheetControlGUI *scg, GnmCanvas *gcanvas,
double x, double y)
{
gnm_pane_objects_drag (gcanvas->pane, NULL, x, y, 8, FALSE, FALSE);
GdkWindow *window;
GdkModifierType mask;
int xp, yp;
window = gtk_widget_get_parent_window (GTK_WIDGET (gcanvas));
gdk_window_get_pointer (window, &xp, &yp, &mask);
gnm_pane_objects_drag (gcanvas->pane, NULL, x, y, 8, FALSE,
(mask & GDK_SHIFT_MASK) != 0);
scg_objects_drag_commit (scg, 8, FALSE);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment