summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonsta <[email protected]>2015-12-25 13:34:05 +0300
committermonsta <[email protected]>2016-02-10 17:44:38 +0300
commit2f89a4feeae5fdf3915be3357fedfeb7e9c05408 (patch)
tree186c3a9e31dbf6af30772a5988d2af0f10c6be06
parent3709dc03c4f9a8c98099666419bda06a1bc419b2 (diff)
downloadpluma-2f89a4feeae5fdf3915be3357fedfeb7e9c05408.tar.bz2
pluma-2f89a4feeae5fdf3915be3357fedfeb7e9c05408.tar.xz
view: fix incremental search entry color when text isn't found (GTK+3)
color and bg color depend on theme, so it won't always be white-on-red as in GTK+2 build
-rw-r--r--pluma/pluma-view.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/pluma/pluma-view.c b/pluma/pluma-view.c
index 9b1875c2..28109bac 100644
--- a/pluma/pluma-view.c
+++ b/pluma/pluma-view.c
@@ -759,8 +759,15 @@ static void
set_entry_state (GtkWidget *entry,
PlumaSearchEntryState state)
{
+#if GTK_CHECK_VERSION (3, 0 ,0)
+ GtkStyleContext *context = gtk_widget_get_style_context (GTK_WIDGET (entry));
+#endif
+
if (state == PLUMA_SEARCH_ENTRY_NOT_FOUND)
{
+#if GTK_CHECK_VERSION (3, 0 ,0)
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_ERROR);
+#else
GdkColor red;
GdkColor white;
@@ -775,15 +782,20 @@ set_entry_state (GtkWidget *entry,
gtk_widget_modify_text (entry,
GTK_STATE_NORMAL,
&white);
+#endif
}
else /* reset */
{
+#if GTK_CHECK_VERSION (3, 0 ,0)
+ gtk_style_context_remove_class (context, GTK_STYLE_CLASS_ERROR);
+#else
gtk_widget_modify_base (entry,
GTK_STATE_NORMAL,
NULL);
gtk_widget_modify_text (entry,
GTK_STATE_NORMAL,
NULL);
+#endif
}
}