[gnome-applets] charpick: don't use deprecated gtk_rc_parse_string
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-applets] charpick: don't use deprecated gtk_rc_parse_string
- Date: Mon, 24 Nov 2014 06:28:36 +0000 (UTC)
commit c134f72a483e9ca42fc4e49c057cb6e9173d1f1e
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Mon Nov 24 08:17:10 2014 +0200
charpick: don't use deprecated gtk_rc_parse_string
charpick/charpick.c | 39 +++++++++++++++++++++++----------------
1 files changed, 23 insertions(+), 16 deletions(-)
---
diff --git a/charpick/charpick.c b/charpick/charpick.c
index dac9547..f4d5bb7 100644
--- a/charpick/charpick.c
+++ b/charpick/charpick.c
@@ -369,22 +369,29 @@ chooser_button_clicked (GtkButton *button, charpick_data *curr_data)
static inline void force_no_focus_padding (GtkWidget *widget)
{
- gboolean first_time=TRUE;
-
- if (first_time) {
- gtk_rc_parse_string ("\n"
- " style \"charpick-applet-button-style\"\n"
- " {\n"
- " GtkWidget::focus-line-width=0\n"
- " GtkWidget::focus-padding=0\n"
- " }\n"
- "\n"
- " widget \"*.charpick-applet-button\" style \"charpick-applet-button-style\"\n"
- "\n");
- first_time = FALSE;
- }
+ 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;
+ }
- gtk_widget_set_name (widget, "charpick-applet-button");
+ gtk_widget_set_name (widget, "charpick-applet-button");
}
/* creates table of buttons, sets up their callbacks, and packs the table in
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]