diff options
author | infirit <[email protected]> | 2014-11-27 15:23:18 +0100 |
---|---|---|
committer | infirit <[email protected]> | 2014-11-27 15:26:18 +0100 |
commit | 06a00876a690711437d30f7183595734298cd603 (patch) | |
tree | cb668c605cc1e5b1c3e4755df3302d282bb5bf3e /capplets/appearance | |
parent | 037a825ece4ecd0796fcbcdf9876aa51caa1d103 (diff) | |
download | mate-control-center-06a00876a690711437d30f7183595734298cd603.tar.bz2 mate-control-center-06a00876a690711437d30f7183595734298cd603.tar.xz |
Gtk3: size-request signal is no more, use correct api
Diffstat (limited to 'capplets/appearance')
-rw-r--r-- | capplets/appearance/appearance-font.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/capplets/appearance/appearance-font.c b/capplets/appearance/appearance-font.c index 99281f23..1b1d0d06 100644 --- a/capplets/appearance/appearance-font.c +++ b/capplets/appearance/appearance-font.c @@ -58,6 +58,7 @@ static gboolean in_change = FALSE; #ifdef HAVE_XFT2 +#if !GTK_CHECK_VERSION (3, 0, 0) /* * Code for displaying previews of font rendering with various Xft options */ @@ -69,6 +70,7 @@ static void sample_size_request(GtkWidget* darea, GtkRequisition* requisition) requisition->width = gdk_pixbuf_get_width(pixbuf) + 2; requisition->height = gdk_pixbuf_get_height(pixbuf) + 2; } +#endif #if GTK_CHECK_VERSION (3, 0, 0) static void sample_draw(GtkWidget* darea, cairo_t* cr) @@ -78,15 +80,19 @@ static void sample_expose(GtkWidget* darea, GdkEventExpose* expose) { GtkAllocation allocation; GdkPixbuf* pixbuf = g_object_get_data(G_OBJECT(darea), "sample-pixbuf"); +#if !GTK_CHECK_VERSION (3, 0, 0) GdkWindow* window = gtk_widget_get_window(darea); GtkStyle* style = gtk_widget_get_style(darea); int width = gdk_pixbuf_get_width(pixbuf); int height = gdk_pixbuf_get_height(pixbuf); +#endif gtk_widget_get_allocation (darea, &allocation); +#if !GTK_CHECK_VERSION (3, 0, 0) int x = (allocation.width - width) / 2; int y = (allocation.height - height) / 2; +#endif #if GTK_CHECK_VERSION (3, 0, 0) cairo_set_line_width(cr, 1); @@ -318,10 +324,11 @@ static void setup_font_sample(GtkWidget* darea, Antialiasing antialiasing, Hinti g_object_set_data_full(G_OBJECT(darea), "sample-pixbuf", pixbuf, (GDestroyNotify) g_object_unref); - g_signal_connect(darea, "size_request", G_CALLBACK(sample_size_request), NULL); #if GTK_CHECK_VERSION (3, 0, 0) + gtk_widget_set_size_request (GTK_WIDGET(darea), width + 2, height + 2); g_signal_connect(darea, "draw", G_CALLBACK(sample_draw), NULL); #else + g_signal_connect(darea, "size_request", G_CALLBACK(sample_size_request), NULL); g_signal_connect(darea, "expose_event", G_CALLBACK(sample_expose), NULL); #endif } |