summary refs log tree commit diff stats
path: root/src/fe-gtk/fe-gtk.c
diff options
context:
space:
mode:
authorPatrick Griffis <tingping@tingping.se>2016-06-30 08:39:07 -0400
committerPatrick Griffis <tingping@tingping.se>2016-07-05 15:26:05 -0400
commit91df075d62606ee295932f1dfefc98187b5ce839 (patch)
tree0b5798d90df35286cfdbce37fe7feefcf04bc4c1 /src/fe-gtk/fe-gtk.c
parent61685072726915af1cf07d22c8adb4707fcbd6a1 (diff)
Fix input styling with Adwaita 3.20 theme
Diffstat (limited to 'src/fe-gtk/fe-gtk.c')
-rw-r--r--src/fe-gtk/fe-gtk.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/fe-gtk/fe-gtk.c b/src/fe-gtk/fe-gtk.c
index 3e7b8499..325691bf 100644
--- a/src/fe-gtk/fe-gtk.c
+++ b/src/fe-gtk/fe-gtk.c
@@ -254,6 +254,22 @@ const char cursor_color_rc[] =
 	"}"
 	"widget \"*.hexchat-inputbox\" style : application \"xc-ib-st\"";
 
+static const char adwaita_workaround_rc[] =
+	"style \"hexchat-input-workaround\""
+	"{"
+		"engine \"pixmap\" {"
+			"image {"
+				"function = FLAT_BOX\n"
+				"state    = NORMAL\n"
+			"}"
+			"image {"
+				"function = FLAT_BOX\n"
+				"state    = ACTIVE\n"
+			"}"
+		"}"
+	"}"
+	"widget \"*.hexchat-inputbox\" style \"hexchat-input-workaround\"";
+
 GtkStyle *
 create_input_style (GtkStyle *style)
 {
@@ -274,6 +290,16 @@ create_input_style (GtkStyle *style)
 
 	if (prefs.hex_gui_input_style && !done_rc)
 	{
+		GtkSettings *settings = gtk_settings_get_default ();
+		char *theme_name;
+
+		/* gnome-themes-standard 3.20 relies on images to do theming
+		 * so we have to override that. */
+		g_object_get (settings, "gtk-theme-name", &theme_name, NULL);
+		if (!g_strcmp0 (theme_name, "Adwaita"))
+			gtk_rc_parse_string (adwaita_workaround_rc);
+		g_free (theme_name);
+
 		done_rc = TRUE;
 		sprintf (buf, cursor_color_rc, (colors[COL_FG].red >> 8),
 			(colors[COL_FG].green >> 8), (colors[COL_FG].blue >> 8));