diff options
author | infirit <[email protected]> | 2014-11-26 14:59:01 +0100 |
---|---|---|
committer | infirit <[email protected]> | 2014-11-26 18:13:43 +0100 |
commit | 7aebf38bbbe79c3a82fc4723f3fa4b01e230b0f1 (patch) | |
tree | 8bc45fd0079293b4a328d779d4d9ff23356f9900 /drivemount/drive-button.c | |
parent | d2d685818a85b773c49802c494a0c386917b5ee6 (diff) | |
download | mate-applets-7aebf38bbbe79c3a82fc4723f3fa4b01e230b0f1.tar.bz2 mate-applets-7aebf38bbbe79c3a82fc4723f3fa4b01e230b0f1.tar.xz |
Gtk3: don't use deprecated gtk_widget_size_request
Taken from gnome-panel commit: c05c6b07ec493d174062a06caf185d324fd6e0c4
From: Alberts Muktupāvels <[email protected]>
Diffstat (limited to 'drivemount/drive-button.c')
-rw-r--r-- | drivemount/drive-button.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivemount/drive-button.c b/drivemount/drive-button.c index 2b27add8..54daa608 100644 --- a/drivemount/drive-button.c +++ b/drivemount/drive-button.c @@ -380,8 +380,13 @@ drive_button_update (gpointer user_data) g_free (display_name); /* base the icon size on the desired button size */ +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_widget_get_preferred_size (GTK_WIDGET (self), NULL, &button_req); + gtk_widget_get_preferred_size (gtk_bin_get_child (GTK_BIN (self)), NULL, &image_req); +#else gtk_widget_size_request (GTK_WIDGET (self), &button_req); gtk_widget_size_request (gtk_bin_get_child (GTK_BIN (self)), &image_req); +#endif width = self->icon_size - (button_req.width - image_req.width); height = self->icon_size - (button_req.height - image_req.height); @@ -414,7 +419,11 @@ drive_button_update (gpointer user_data) gtk_image_set_from_pixbuf (GTK_IMAGE (gtk_bin_get_child (GTK_BIN (self))), pixbuf); g_object_unref (pixbuf); +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_widget_get_preferred_size (GTK_WIDGET (self), NULL, &button_req); +#else gtk_widget_size_request (GTK_WIDGET (self), &button_req); +#endif return FALSE; } |