[gnome-builder] style: fix search context menu styling when no search matches



commit cc61f8d631cc52e71f0ea0356248d50d9817092f
Author: Christian Hergert <chergert redhat com>
Date:   Tue May 3 14:38:49 2016 +0300

    style: fix search context menu styling when no search matches
    
    This was previously inheriting styling from Adwaita, which gave us a
    white background. Instead, we now set an alternate class name so we are
    in more control.

 data/theme/Adwaita-dark.css      |    2 +-
 data/theme/Adwaita-shared.css    |    4 ++--
 data/theme/Adwaita.css           |    2 +-
 libide/editor/ide-editor-frame.c |    7 +++++--
 4 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/data/theme/Adwaita-dark.css b/data/theme/Adwaita-dark.css
index 955b0fe..fc25069 100644
--- a/data/theme/Adwaita-dark.css
+++ b/data/theme/Adwaita-dark.css
@@ -64,6 +64,6 @@ docktabstrip docktab:checked {
 }
 
 
-entry.error {
+entry.search-missing {
   border-color: #330000;
 }
diff --git a/data/theme/Adwaita-shared.css b/data/theme/Adwaita-shared.css
index 326fb3f..daccec6 100644
--- a/data/theme/Adwaita-shared.css
+++ b/data/theme/Adwaita-shared.css
@@ -116,12 +116,12 @@ layout {
 }
 
 
-entry.error {
+entry.search-missing {
   background-color: #cc0000;
   color: white;
   text-shadow: none;
 }
 
-entry.error > image {
+entry.search-missing > image {
   color: white;
 }
diff --git a/data/theme/Adwaita.css b/data/theme/Adwaita.css
index 8c9a587..aa79ca1 100644
--- a/data/theme/Adwaita.css
+++ b/data/theme/Adwaita.css
@@ -62,6 +62,6 @@ docktabstrip docktab:checked {
 }
 
 
-entry.error {
+entry.search-missing {
   border-color: #aa0000;
 }
diff --git a/libide/editor/ide-editor-frame.c b/libide/editor/ide-editor-frame.c
index 45c3c44..2331a27 100644
--- a/libide/editor/ide-editor-frame.c
+++ b/libide/editor/ide-editor-frame.c
@@ -236,10 +236,13 @@ ide_editor_frame_update_search_position_label (IdeEditorFrame *self)
   context = gtk_widget_get_style_context (GTK_WIDGET (self->search_entry));
   search_text = gtk_entry_get_text (GTK_ENTRY (self->search_entry));
 
+  /* We use our own error class because we don't want to colide with styling
+   * from GTK+ themes.
+   */
   if ((count == 0) && !ide_str_empty0 (search_text))
-    gtk_style_context_add_class (context, GTK_STYLE_CLASS_ERROR);
+    gtk_style_context_add_class (context, "search-missing");
   else
-    gtk_style_context_remove_class (context, GTK_STYLE_CLASS_ERROR);
+    gtk_style_context_remove_class (context, "search-missing");
 
   text = g_strdup_printf (_("%u of %u"), pos, count);
   ide_editor_frame_set_position_label (self, text);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]