summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-11-23 10:39:44 +0100
committerinfirit <[email protected]>2014-11-23 11:12:26 +0100
commit53362cb07c5e9d68cc9ff52c9a9eaf0da3ef585e (patch)
tree87434fcbab952bad04900a88601d4ecf75c53703
parent8f1cfbc8ba138281acd29b9f3704849262e2dc70 (diff)
downloadmate-panel-53362cb07c5e9d68cc9ff52c9a9eaf0da3ef585e.tar.bz2
mate-panel-53362cb07c5e9d68cc9ff52c9a9eaf0da3ef585e.tar.xz
Gtk3: clock: Port gtk_rc_parse_string to GtkCssProvider
Based on gnome-panel commit: 71c3290e3895b71be6bce0e909c4b414bd190b5e From: Germán Póo-Caamaño <[email protected]>
-rw-r--r--applets/clock/clock.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/applets/clock/clock.c b/applets/clock/clock.c
index 56a991ea..586f857d 100644
--- a/applets/clock/clock.c
+++ b/applets/clock/clock.c
@@ -1261,8 +1261,22 @@ 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) {
+ provider = gtk_css_provider_new ();
+ gtk_css_provider_load_from_data (provider,
+ "#clock-applet-button {\n"
+ " -GtkWidget-focus-line-width: 0px;\n"
+ " -GtkWidget-focus-padding: 0px; }",
+ -1, NULL);
+ gtk_style_context_add_provider (gtk_widget_get_style_context (widget),
+ GTK_STYLE_PROVIDER (provider),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ g_object_unref (provider);
+#else
+ if (first_time) {
gtk_rc_parse_string ("\n"
" style \"clock-applet-button-style\"\n"
" {\n"
@@ -1272,6 +1286,7 @@ force_no_focus_padding (GtkWidget *widget)
"\n"
" widget \"*.clock-applet-button\" style \"clock-applet-button-style\"\n"
"\n");
+#endif
first_time = FALSE;
}