summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-11-26 22:17:43 +0100
committerinfirit <[email protected]>2014-11-26 23:06:14 +0100
commit8397197bdad2f4a067d4891f18702c78fa7ca969 (patch)
tree39704c9c3dbe805881a9154e4bd8ffd2ba0e486d
parentfaaee1e86bc0e751693bc2297893bffe127e3c3c (diff)
downloadmate-applets-8397197bdad2f4a067d4891f18702c78fa7ca969.tar.bz2
mate-applets-8397197bdad2f4a067d4891f18702c78fa7ca969.tar.xz
Gtk3: charpick: don't use deprecated gtk_rc_parse_string
Based on gnome-applets commit: c134f72a483e9ca42fc4e49c057cb6e9173d1f1e From: Alberts Muktupāvels <[email protected]>
-rw-r--r--charpick/charpick.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/charpick/charpick.c b/charpick/charpick.c
index b99e9d07..572064f0 100644
--- a/charpick/charpick.c
+++ b/charpick/charpick.c
@@ -382,6 +382,29 @@ chooser_button_clicked (GtkButton *button, charpick_data *curr_data)
static inline void force_no_focus_padding (GtkWidget *widget)
{
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gboolean first_time = TRUE;
+ GtkCssProvider *provider;
+
+ if (first_time) {
+ provider = gtk_css_provider_new ();
+
+ gtk_css_provider_load_from_data (provider,
+ "#charpick-applet-button {\n"
+ "-GtkWidget-focus-line-width: 0px;\n"
+ "-GtkWidget-focus-padding: 0px;\n"
+ "}",
+ -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);
+
+ first_time = FALSE;
+ }
+#else
gboolean first_time=TRUE;
if (first_time) {
@@ -396,6 +419,7 @@ static inline void force_no_focus_padding (GtkWidget *widget)
"\n");
first_time = FALSE;
}
+#endif
gtk_widget_set_name (widget, "charpick-applet-button");
}