From e8d4ba8f373a257d959a33bbf121dc1cdcab6dbb Mon Sep 17 00:00:00 2001 From: infirit Date: Thu, 27 Nov 2014 15:45:06 +0100 Subject: Revert "Gtk3: size-request signal is no more, use correct api" This reverts commit 06a00876a690711437d30f7183595734298cd603. --- capplets/appearance/appearance-font.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'capplets') diff --git a/capplets/appearance/appearance-font.c b/capplets/appearance/appearance-font.c index 2c2cd072..5a6a7847 100644 --- a/capplets/appearance/appearance-font.c +++ b/capplets/appearance/appearance-font.c @@ -58,7 +58,6 @@ 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 */ @@ -70,7 +69,6 @@ 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) @@ -80,19 +78,15 @@ 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); @@ -324,11 +318,10 @@ 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 } -- cgit v1.2.1