diff options
author | Marco Pesenti Gritti <marco@gnome.org> | 2003-10-13 20:26:41 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <marco@src.gnome.org> | 2003-10-13 20:26:41 +0800 |
commit | a30db0d7c1dcdbc6d6962564ccf25615518a1d05 (patch) | |
tree | 4dac62b87b31783d34ce970aeb39c058a4214354 /lib | |
parent | b5bb571a77966979bd38e0de14caccc82d9fb1ff (diff) | |
download | gsoc2013-epiphany-a30db0d7c1dcdbc6d6962564ccf25615518a1d05.tar gsoc2013-epiphany-a30db0d7c1dcdbc6d6962564ccf25615518a1d05.tar.gz gsoc2013-epiphany-a30db0d7c1dcdbc6d6962564ccf25615518a1d05.tar.bz2 gsoc2013-epiphany-a30db0d7c1dcdbc6d6962564ccf25615518a1d05.tar.lz gsoc2013-epiphany-a30db0d7c1dcdbc6d6962564ccf25615518a1d05.tar.xz gsoc2013-epiphany-a30db0d7c1dcdbc6d6962564ccf25615518a1d05.tar.zst gsoc2013-epiphany-a30db0d7c1dcdbc6d6962564ccf25615518a1d05.zip |
Better implementation of cursor.
2003-10-13 Marco Pesenti Gritti <marco@gnome.org>
* lib/egg/egg-editable-toolbar.c: (set_drag_cursor),
(unset_drag_cursor), (create_item),
(egg_editable_toolbar_set_edit_mode):
Better implementation of cursor.
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/egg/egg-editable-toolbar.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/lib/egg/egg-editable-toolbar.c b/lib/egg/egg-editable-toolbar.c index afc824dd1..fdc43eee8 100755 --- a/lib/egg/egg-editable-toolbar.c +++ b/lib/egg/egg-editable-toolbar.c @@ -355,24 +355,26 @@ set_item_drag_source (GtkWidget *item, } } -static gboolean -enter_notify_cb (GtkWidget *widget, GdkEventCrossing *event) +static void +set_drag_cursor (GtkWidget *widget) { - GdkCursor *cursor; - - cursor = gdk_cursor_new (GDK_FLEUR); - gdk_window_set_cursor (widget->window, cursor); - gdk_cursor_unref (cursor); + if (widget->window) + { + GdkCursor *cursor; - return TRUE; + cursor = gdk_cursor_new (GDK_FLEUR); + gdk_window_set_cursor (widget->window, cursor); + gdk_cursor_unref (cursor); + } } -static gboolean -leave_notify_cb (GtkWidget *widget, GdkEventCrossing *event) +static void +unset_drag_cursor (GtkWidget *widget) { - gdk_window_set_cursor (widget->window, NULL); - - return TRUE; + if (widget->window) + { + gdk_window_set_cursor (widget->window, NULL); + } } static GtkWidget * @@ -404,10 +406,7 @@ create_item (EggEditableToolbar *t, } gtk_widget_show (item); - g_signal_connect (item, "enter_notify_event", - G_CALLBACK (enter_notify_cb), t); - g_signal_connect (item, "leave_notify_event", - G_CALLBACK (leave_notify_cb), t); + g_signal_connect (item, "drag_data_get", G_CALLBACK (drag_data_get_cb), t); g_signal_connect (item, "drag_data_delete", @@ -415,6 +414,7 @@ create_item (EggEditableToolbar *t, if (t->priv->edit_mode) { + set_drag_cursor (item); gtk_widget_set_sensitive (item, TRUE); set_item_drag_source (item, action, is_separator); gtk_tool_item_set_use_drag_window (GTK_TOOL_ITEM (item), TRUE); @@ -748,11 +748,13 @@ egg_editable_toolbar_set_edit_mode (EggEditableToolbar *etoolbar, if (mode) { + set_drag_cursor (GTK_WIDGET (item)); gtk_widget_set_sensitive (GTK_WIDGET (item), TRUE); set_item_drag_source (GTK_WIDGET (item), action, is_separator); } else { + unset_drag_cursor (GTK_WIDGET (item)); gtk_drag_source_unset (GTK_WIDGET (item)); if (!is_separator) |