aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2003-10-25 00:28:47 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2003-10-25 00:28:47 +0800
commit3f06c2cd8f49d72dfde45c08c24b398e56ea6d87 (patch)
tree481ab428662f6d097e958dd3907f1316d621c4de
parent0504846a2bf2ead8e1bdec6fc679147232ad9bfd (diff)
downloadgsoc2013-epiphany-3f06c2cd8f49d72dfde45c08c24b398e56ea6d87.tar
gsoc2013-epiphany-3f06c2cd8f49d72dfde45c08c24b398e56ea6d87.tar.gz
gsoc2013-epiphany-3f06c2cd8f49d72dfde45c08c24b398e56ea6d87.tar.bz2
gsoc2013-epiphany-3f06c2cd8f49d72dfde45c08c24b398e56ea6d87.tar.lz
gsoc2013-epiphany-3f06c2cd8f49d72dfde45c08c24b398e56ea6d87.tar.xz
gsoc2013-epiphany-3f06c2cd8f49d72dfde45c08c24b398e56ea6d87.tar.zst
gsoc2013-epiphany-3f06c2cd8f49d72dfde45c08c24b398e56ea6d87.zip
Use special drag cursors also for editor. Do not hide separator when
2003-10-24 Marco Pesenti Gritti <marco@gnome.org> * lib/egg/egg-toolbar-editor.c: (set_drag_cursor), (event_box_realize_cb), (editor_create_item): Use special drag cursors also for editor. Do not hide separator when dragging it.
-rw-r--r--ChangeLog8
-rwxr-xr-xlib/egg/egg-toolbar-editor.c35
2 files changed, 39 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 173afa3c8..3c078643a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2003-10-24 Marco Pesenti Gritti <marco@gnome.org>
+
+ * lib/egg/egg-toolbar-editor.c: (set_drag_cursor),
+ (event_box_realize_cb), (editor_create_item):
+
+ Use special drag cursors also for editor.
+ Do not hide separator when dragging it.
+
2003-10-24 David Bordoley <bordoley@msu.edu>
* data/art/hand-open.png:
diff --git a/lib/egg/egg-toolbar-editor.c b/lib/egg/egg-toolbar-editor.c
index d5f8f718e..88c43bca0 100755
--- a/lib/egg/egg-toolbar-editor.c
+++ b/lib/egg/egg-toolbar-editor.c
@@ -342,6 +342,26 @@ elide_underscores (const gchar *original)
return result;
}
+static void
+set_drag_cursor (GtkWidget *widget)
+{
+ GdkCursor *cursor;
+ GdkPixbuf *pixbuf;
+
+ pixbuf = gdk_pixbuf_new_from_file (CURSOR_DIR "/art/hand-open.png", NULL);
+ cursor = gdk_cursor_new_from_pixbuf (gdk_display_get_default (), pixbuf, 0, 0);
+
+ gdk_window_set_cursor (widget->window, cursor);
+ gdk_cursor_unref (cursor);
+ g_object_unref (pixbuf);
+}
+
+static void
+event_box_realize_cb (GtkWidget *widget)
+{
+ set_drag_cursor (widget);
+}
+
static GtkWidget *
editor_create_item (EggToolbarEditor *editor,
GtkImage *icon,
@@ -355,18 +375,25 @@ editor_create_item (EggToolbarEditor *editor,
GtkImageType type;
event_box = gtk_event_box_new ();
+ gtk_event_box_set_visible_window (GTK_EVENT_BOX (event_box), FALSE);
gtk_widget_show (event_box);
gtk_drag_source_set (event_box,
GDK_BUTTON1_MASK,
source_drag_types, n_source_drag_types, action);
- g_signal_connect (event_box, "drag_begin",
- G_CALLBACK (drag_begin_cb), NULL);
- g_signal_connect (event_box, "drag_end",
- G_CALLBACK (drag_end_cb), NULL);
g_signal_connect (event_box, "drag_data_get",
G_CALLBACK (drag_data_get_cb), editor);
g_signal_connect (event_box, "drag_data_delete",
G_CALLBACK (editor_drag_data_delete_cb), editor);
+ g_signal_connect_after (event_box, "realize",
+ G_CALLBACK (event_box_realize_cb), NULL);
+
+ if (action == GDK_ACTION_MOVE)
+ {
+ g_signal_connect (event_box, "drag_begin",
+ G_CALLBACK (drag_begin_cb), NULL);
+ g_signal_connect (event_box, "drag_end",
+ G_CALLBACK (drag_end_cb), NULL);
+ }
type = gtk_image_get_storage_type (icon);
if (type == GTK_IMAGE_STOCK)