summaryrefslogtreecommitdiff
path: root/capplets/common/theme-thumbnail.c
diff options
context:
space:
mode:
authormonsta <[email protected]>2016-01-27 16:29:56 +0300
committermonsta <[email protected]>2016-01-27 16:29:56 +0300
commitc90b9b5ab82229b0b615090331c0bd1f425c98b2 (patch)
tree6cb9b5444d345e13e4393cce552ebda6735ce82b /capplets/common/theme-thumbnail.c
parent73f3250122c85809d6cb07a15b979073fc2ea8e5 (diff)
downloadmate-control-center-c90b9b5ab82229b0b615090331c0bd1f425c98b2.tar.bz2
mate-control-center-c90b9b5ab82229b0b615090331c0bd1f425c98b2.tar.xz
[GTK+3] common: use gtk_widget_get_preferred_size
Diffstat (limited to 'capplets/common/theme-thumbnail.c')
-rw-r--r--capplets/common/theme-thumbnail.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/capplets/common/theme-thumbnail.c b/capplets/common/theme-thumbnail.c
index a31e24fd..537e25c8 100644
--- a/capplets/common/theme-thumbnail.c
+++ b/capplets/common/theme-thumbnail.c
@@ -19,6 +19,10 @@
#include "gtkrc-utils.h"
#include "capplet-util.h"
+#if !GTK_CHECK_VERSION (3, 0, 0)
+#define gtk_widget_get_preferred_size(x,y,z) gtk_widget_size_request(x,y)
+#endif
+
typedef struct {
gboolean set;
gint thumbnail_width;
@@ -327,13 +331,13 @@ create_meta_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data)
gtk_window_set_default_size (GTK_WINDOW (window), META_THUMBNAIL_SIZE, META_THUMBNAIL_SIZE);
- gtk_widget_size_request (window, &requisition);
+ gtk_widget_get_preferred_size (window, &requisition, NULL);
allocation.x = 0;
allocation.y = 0;
allocation.width = META_THUMBNAIL_SIZE;
allocation.height = META_THUMBNAIL_SIZE;
gtk_widget_size_allocate (window, &allocation);
- gtk_widget_size_request (window, &requisition);
+ gtk_widget_get_preferred_size (window, &requisition, NULL);
#if GTK_CHECK_VERSION (3, 0, 0)
pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, META_THUMBNAIL_SIZE, META_THUMBNAIL_SIZE);
@@ -421,13 +425,13 @@ create_gtk_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data)
gtk_widget_map (checkbox);
gtk_widget_map (radio);
- gtk_widget_size_request (window, &requisition);
+ gtk_widget_get_preferred_size (window, &requisition, NULL);
allocation.x = 0;
allocation.y = 0;
allocation.width = requisition.width;
allocation.height = requisition.height;
gtk_widget_size_allocate (window, &allocation);
- gtk_widget_size_request (window, &requisition);
+ gtk_widget_get_preferred_size (window, &requisition, NULL);
gtk_window_get_size (GTK_WINDOW (window), &width, &height);
@@ -500,13 +504,13 @@ create_marco_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data)
gtk_widget_show_all (preview);
gtk_widget_map (dummy);
- gtk_widget_size_request (window, &requisition);
+ gtk_widget_get_preferred_size (window, &requisition, NULL);
allocation.x = 0;
allocation.y = 0;
allocation.width = (int) MARCO_THUMBNAIL_WIDTH * 1.2;
allocation.height = (int) MARCO_THUMBNAIL_HEIGHT * 1.2;
gtk_widget_size_allocate (window, &allocation);
- gtk_widget_size_request (window, &requisition);
+ gtk_widget_get_preferred_size (window, &requisition, NULL);
#if GTK_CHECK_VERSION (3, 0, 0)
pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, (int) MARCO_THUMBNAIL_WIDTH * 1.2, (int) MARCO_THUMBNAIL_HEIGHT * 1.2);