From 0aa05dc52ee3c1988c6a33b529bdee3275693e2d Mon Sep 17 00:00:00 2001 From: Wolfgang Ulbrich Date: Thu, 11 Feb 2016 08:03:12 +0100 Subject: GTK+-3.20 clock: remove deprecated style properties taken from: https://git.gnome.org/browse/gnome-panel/commit/?id=c5549ba --- applets/clock/clock.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'applets/clock') diff --git a/applets/clock/clock.c b/applets/clock/clock.c index 3c512474..370bf9ac 100644 --- a/applets/clock/clock.c +++ b/applets/clock/clock.c @@ -1351,11 +1351,12 @@ clock_update_text_gravity (GtkWidget *label) pango_context_set_base_gravity (context, PANGO_GRAVITY_AUTO); } +#if GTK_CHECK_VERSION (3, 0, 0) +#if !GTK_CHECK_VERSION (3, 19, 0) static inline void force_no_focus_padding (GtkWidget *widget) { static gboolean first_time = TRUE; -#if GTK_CHECK_VERSION (3, 0, 0) GtkCssProvider *provider; if (first_time) { @@ -1369,7 +1370,17 @@ force_no_focus_padding (GtkWidget *widget) GTK_STYLE_PROVIDER (provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); g_object_unref (provider); + first_time = FALSE; + } + + gtk_widget_set_name (widget, "clock-applet-button"); +} +#endif #else +static inline void +force_no_focus_padding (GtkWidget *widget) +{ + static gboolean first_time = TRUE; if (first_time) { gtk_rc_parse_string ("\n" " style \"clock-applet-button-style\"\n" @@ -1380,12 +1391,12 @@ force_no_focus_padding (GtkWidget *widget) "\n" " widget \"*.clock-applet-button\" style \"clock-applet-button-style\"\n" "\n"); -#endif first_time = FALSE; } gtk_widget_set_name (widget, "clock-applet-button"); } +#endif static GtkWidget * create_main_clock_button (void) @@ -1395,7 +1406,11 @@ create_main_clock_button (void) button = gtk_toggle_button_new (); gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE); +#if GTK_CHECK_VERSION (3, 19, 0) + gtk_widget_set_name (button, "clock-applet-button"); +#else force_no_focus_padding (button); +#endif return button; } -- cgit v1.2.1