From a2b898b610c7150a8e1c904afbe0f936b7069e4f Mon Sep 17 00:00:00 2001 From: Přemysl Janouch Date: Thu, 9 Jun 2011 21:56:38 +0200 Subject: Change the cursor when scrolling the view. For consistency with other GTK+ applications. --- liblogdiag/ld-diagram-view.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/liblogdiag/ld-diagram-view.c b/liblogdiag/ld-diagram-view.c index 17a9909..1898177 100644 --- a/liblogdiag/ld-diagram-view.c +++ b/liblogdiag/ld-diagram-view.c @@ -302,6 +302,7 @@ static void ld_diagram_view_real_cancel_operation (LdDiagramView *self); static void oper_move_view_begin (LdDiagramView *self, const LdPoint *point); static void oper_move_view_motion (LdDiagramView *self, const LdPoint *point); +static void oper_move_view_end (LdDiagramView *self); static void oper_add_object_end (LdDiagramView *self); @@ -1757,15 +1758,20 @@ static void oper_move_view_begin (LdDiagramView *self, const LdPoint *point) { MoveViewData *data; + GdkCursor *move_cursor; g_signal_emit (self, LD_DIAGRAM_VIEW_GET_CLASS (self)->cancel_operation_signal, 0); self->priv->operation = OPER_MOVE_VIEW; - self->priv->operation_end = NULL; + self->priv->operation_end = oper_move_view_end; data = &OPER_DATA (self, move_view); data->last_pos = *point; + + move_cursor = gdk_cursor_new (GDK_FLEUR); + gdk_window_set_cursor (GTK_WIDGET (self)->window, move_cursor); + gdk_cursor_unref (move_cursor); } static void @@ -1785,6 +1791,12 @@ oper_move_view_motion (LdDiagramView *self, const LdPoint *point) data->last_pos = *point; } +static void +oper_move_view_end (LdDiagramView *self) +{ + gdk_window_set_cursor (GTK_WIDGET (self)->window, NULL); +} + /** * ld_diagram_view_add_object_begin: * @self: an #LdDiagramView object. -- cgit v1.2.3-70-g09d2