diff options
author | Crispin Flowerday <gnome@flowerday.cx> | 2004-05-22 17:39:51 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2004-05-22 17:39:51 +0800 |
commit | 66a4bc115ab840e3fd32e613d15d9df9bba618fa (patch) | |
tree | 6a021ebcd1982e66054a1b3c9bb9dc27f98f189d | |
parent | 6435a75dc6e1566300bcad665a08cbb14a9d4643 (diff) | |
download | gsoc2013-epiphany-66a4bc115ab840e3fd32e613d15d9df9bba618fa.tar gsoc2013-epiphany-66a4bc115ab840e3fd32e613d15d9df9bba618fa.tar.gz gsoc2013-epiphany-66a4bc115ab840e3fd32e613d15d9df9bba618fa.tar.bz2 gsoc2013-epiphany-66a4bc115ab840e3fd32e613d15d9df9bba618fa.tar.lz gsoc2013-epiphany-66a4bc115ab840e3fd32e613d15d9df9bba618fa.tar.xz gsoc2013-epiphany-66a4bc115ab840e3fd32e613d15d9df9bba618fa.tar.zst gsoc2013-epiphany-66a4bc115ab840e3fd32e613d15d9df9bba618fa.zip |
Set the drag icon on realize, otherwise the current icon theme isn't used,
2004-05-22 Crispin Flowerday <gnome@flowerday.cx>
* libegg/toolbareditor/egg-toolbar-editor.c
(event_box_realize_cb), (editor_create_item):
Set the drag icon on
realize, otherwise the current icon theme isn't used, and it falls
back to the default theme.
-rw-r--r-- | ChangeLog | 9 | ||||
-rwxr-xr-x | lib/egg/egg-toolbar-editor.c | 43 |
2 files changed, 31 insertions, 21 deletions
@@ -1,3 +1,12 @@ +2004-05-22 Crispin Flowerday <gnome@flowerday.cx> + + * libegg/toolbareditor/egg-toolbar-editor.c + (event_box_realize_cb), (editor_create_item): + + Set the drag icon on + realize, otherwise the current icon theme isn't used, and it falls + back to the default theme. + 2004-05-22 Christian Persch <chpe@cvs.gnome.org> * configure.in: diff --git a/lib/egg/egg-toolbar-editor.c b/lib/egg/egg-toolbar-editor.c index 7f0aaf235..65902a082 100755 --- a/lib/egg/egg-toolbar-editor.c +++ b/lib/egg/egg-toolbar-editor.c @@ -419,9 +419,28 @@ set_drag_cursor (GtkWidget *widget) } static void -event_box_realize_cb (GtkWidget *widget) +event_box_realize_cb (GtkWidget *widget, GtkImage *icon) { - set_drag_cursor (widget); + GtkImageType type; + + set_drag_cursor (widget); + + type = gtk_image_get_storage_type (icon); + if (type == GTK_IMAGE_STOCK) + { + gchar *stock_id; + GdkPixbuf *pixbuf; + gtk_image_get_stock (icon, &stock_id, NULL); + pixbuf = gtk_widget_render_icon (widget, stock_id, + GTK_ICON_SIZE_LARGE_TOOLBAR, NULL); + gtk_drag_source_set_icon_pixbuf (widget, pixbuf); + g_object_unref (pixbuf); + } + else if (type == GTK_IMAGE_PIXBUF) + { + GdkPixbuf *pixbuf = gtk_image_get_pixbuf (icon); + gtk_drag_source_set_icon_pixbuf (widget, pixbuf); + } } static GtkWidget * @@ -434,7 +453,6 @@ editor_create_item (EggToolbarEditor *editor, GtkWidget *vbox; GtkWidget *label; gchar *label_no_mnemonic = NULL; - GtkImageType type; event_box = gtk_event_box_new (); gtk_event_box_set_visible_window (GTK_EVENT_BOX (event_box), FALSE); @@ -447,7 +465,7 @@ editor_create_item (EggToolbarEditor *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); + G_CALLBACK (event_box_realize_cb), icon); if (action == GDK_ACTION_MOVE) { @@ -457,23 +475,6 @@ editor_create_item (EggToolbarEditor *editor, G_CALLBACK (drag_end_cb), NULL); } - type = gtk_image_get_storage_type (icon); - if (type == GTK_IMAGE_STOCK) - { - gchar *stock_id; - GdkPixbuf *pixbuf; - gtk_image_get_stock (icon, &stock_id, NULL); - pixbuf = gtk_widget_render_icon (event_box, stock_id, - GTK_ICON_SIZE_LARGE_TOOLBAR, NULL); - gtk_drag_source_set_icon_pixbuf (event_box, pixbuf); - g_object_unref (pixbuf); - } - else if (type == GTK_IMAGE_PIXBUF) - { - GdkPixbuf *pixbuf = gtk_image_get_pixbuf (icon); - gtk_drag_source_set_icon_pixbuf (event_box, pixbuf); - } - vbox = gtk_vbox_new (0, FALSE); gtk_widget_show (vbox); gtk_container_add (GTK_CONTAINER (event_box), vbox); |