summaryrefslogtreecommitdiff
path: root/libslab/nameplate-tile.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2014-01-24 16:01:49 +0100
committerStefano Karapetsas <[email protected]>2014-01-24 16:01:49 +0100
commit80c3d8ace4794481e711fb63e4eefd9f1f5cc1ef (patch)
treec9ca5dade16593759c5d2ced120c028e963ae7d6 /libslab/nameplate-tile.c
parent31bfbb9e6aba9a1c82999823f7a3cd9dd6ec500b (diff)
downloadmate-control-center-80c3d8ace4794481e711fb63e4eefd9f1f5cc1ef.tar.bz2
mate-control-center-80c3d8ace4794481e711fb63e4eefd9f1f5cc1ef.tar.xz
libslab: Add GTK3 support
Diffstat (limited to 'libslab/nameplate-tile.c')
-rw-r--r--libslab/nameplate-tile.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/libslab/nameplate-tile.c b/libslab/nameplate-tile.c
index f3f45165..6e0da244 100644
--- a/libslab/nameplate-tile.c
+++ b/libslab/nameplate-tile.c
@@ -262,6 +262,9 @@ nameplate_tile_drag_begin (GtkWidget * widget, GdkDragContext * context)
{
NameplateTile *this = NAMEPLATE_TILE (widget);
GtkImage *image;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ const gchar *name;
+#endif
(*GTK_WIDGET_CLASS (nameplate_tile_parent_class)->drag_begin) (widget, context);
@@ -270,6 +273,26 @@ nameplate_tile_drag_begin (GtkWidget * widget, GdkDragContext * context)
image = GTK_IMAGE (this->image);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ switch (gtk_image_get_storage_type (image))
+ {
+ case GTK_IMAGE_PIXBUF:
+ if (gtk_image_get_pixbuf (image))
+ gtk_drag_set_icon_pixbuf (context, gtk_image_get_pixbuf (image), 0, 0);
+
+ break;
+
+ case GTK_IMAGE_ICON_NAME:
+ gtk_image_get_icon_name (image, name, NULL);
+ if (name)
+ gtk_drag_set_icon_name (context, name, 0, 0);
+
+ break;
+
+ default:
+ break;
+ }
+#else
switch (image->storage_type)
{
case GTK_IMAGE_PIXBUF:
@@ -287,4 +310,5 @@ nameplate_tile_drag_begin (GtkWidget * widget, GdkDragContext * context)
default:
break;
}
+#endif
}