[gnome-latex/wip/misc] Remove ErrorEntry, use GTK_STYLE_CLASS_ERROR



commit 4d655cdaea90c198070aa0846f6a8d40ffc73e7a
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sun Apr 19 21:49:10 2020 +0200

    Remove ErrorEntry, use GTK_STYLE_CLASS_ERROR

 po/POTFILES.in       |  1 -
 po/POTFILES.skip     |  1 -
 src/Makefile.am      |  1 -
 src/error_entry.vala | 72 ----------------------------------------------------
 src/search.vala      | 18 ++++++++-----
 5 files changed, 11 insertions(+), 82 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index b8c5bb1..9770617 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -20,7 +20,6 @@ src/document_tab.vala
 src/document.vala
 src/document_view.vala
 src/encodings.vala
-src/error_entry.vala
 src/file_browser.vala
 src/glatex_app.vala
 src/latex_menu.vala
diff --git a/po/POTFILES.skip b/po/POTFILES.skip
index 779af36..b558111 100644
--- a/po/POTFILES.skip
+++ b/po/POTFILES.skip
@@ -15,7 +15,6 @@ src/document_structure.c
 src/document_tab.c
 src/document_view.c
 src/encodings.c
-src/error_entry.c
 src/file_browser.c
 src/glatex_app.c
 src/latex_menu.c
diff --git a/src/Makefile.am b/src/Makefile.am
index 1e0f182..4dc0e8d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -36,7 +36,6 @@ vala_files =                          \
        document.vala                   \
        document_view.vala              \
        encodings.vala                  \
-       error_entry.vala                \
        factory.vala                    \
        file_browser.vala               \
        glatex_app.vala                 \
diff --git a/src/search.vala b/src/search.vala
index 263faad..4736304 100644
--- a/src/search.vala
+++ b/src/search.vala
@@ -1,7 +1,7 @@
 /*
  * This file is part of GNOME LaTeX.
  *
- * Copyright © 2010-2012, 2017 Sébastien Wilmet
+ * Copyright © 2010-2020 Sébastien Wilmet
  *
  * GNOME LaTeX is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -63,9 +63,11 @@ public class GotoLine : Grid
 
     private void on_changed ()
     {
+        StyleContext style_context = entry.get_style_context ();
+
         if (entry.text_length == 0)
         {
-            ErrorEntry.remove_error (entry);
+            style_context.remove_class (STYLE_CLASS_ERROR);
             return;
         }
 
@@ -77,7 +79,7 @@ public class GotoLine : Grid
             unichar c = text[i];
             if (!c.isdigit ())
             {
-                ErrorEntry.add_error (entry);
+                style_context.add_class (STYLE_CLASS_ERROR);
                 return;
             }
         }
@@ -85,9 +87,9 @@ public class GotoLine : Grid
         int line = int.parse (text) - 1;
 
         if (main_window.active_view.goto_line (line))
-            ErrorEntry.remove_error (entry);
+            style_context.remove_class (STYLE_CLASS_ERROR);
         else
-            ErrorEntry.add_error (entry);
+            style_context.add_class (STYLE_CLASS_ERROR);
     }
 }
 
@@ -406,12 +408,14 @@ public class SearchAndReplace : GLib.Object
 
         _search_context.notify["occurrences-count"].connect (() =>
         {
+            StyleContext style_context = _entry_find.get_style_context ();
+
             if (_search_context.occurrences_count == 0 &&
                 _search_settings.get_search_text () != null)
-                ErrorEntry.add_error (_entry_find);
+                style_context.add_class (STYLE_CLASS_ERROR);
 
             else if (_search_context.occurrences_count >= 0)
-                ErrorEntry.remove_error (_entry_find);
+                style_context.remove_class (STYLE_CLASS_ERROR);
 
             update_info_label ();
         });


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