From f0c5d5c5511b86b9468dad0ad8bd22663d133c04 Mon Sep 17 00:00:00 2001 From: monsta Date: Mon, 30 Jan 2017 17:44:36 +0300 Subject: clock: fix remaining deprecation for GTK+ >= 3.20 --- applets/clock/clock.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/applets/clock/clock.c b/applets/clock/clock.c index ae45886c..e2fa6206 100644 --- a/applets/clock/clock.c +++ b/applets/clock/clock.c @@ -405,8 +405,10 @@ calculate_minimum_height (GtkWidget *widget, #endif PangoContext *pango_context; PangoFontMetrics *metrics; +#if !GTK_CHECK_VERSION (3, 20, 0) int focus_width = 0; int focus_pad = 0; +#endif int ascent; int descent; int thickness; @@ -435,10 +437,12 @@ calculate_minimum_height (GtkWidget *widget, #if GTK_CHECK_VERSION (3, 0, 0) gtk_style_context_get_padding (style_context, state, &padding); +#if !GTK_CHECK_VERSION (3, 20, 0) gtk_style_context_get_style (style_context, "focus-line-width", &focus_width, "focus-padding", &focus_pad, NULL); +#endif #else gtk_widget_style_get (widget, "focus-line-width", &focus_width, @@ -461,7 +465,11 @@ calculate_minimum_height (GtkWidget *widget, #endif } +#if GTK_CHECK_VERSION (3, 20, 0) + return PANGO_PIXELS (ascent + descent) + thickness; +#else return PANGO_PIXELS (ascent + descent) + 2 * (focus_width + focus_pad) + thickness; +#endif } static gboolean -- cgit v1.2.1