[pitivi] greeterperspective: Add no result state for search entry



commit 433ab7153764a2b4231cfdaf8414c16a5b0a9465
Author: ymdatta <ymdatta protonmail com>
Date:   Thu Jan 31 02:28:12 2019 +0530

    greeterperspective: Add no result state for search entry
    
    On opening dialog, when user searches for a project, on
    no search results, set the 'error' style on search entry.

 pitivi/greeterperspective.py | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/pitivi/greeterperspective.py b/pitivi/greeterperspective.py
index 58703e9d..77e2a46e 100644
--- a/pitivi/greeterperspective.py
+++ b/pitivi/greeterperspective.py
@@ -372,6 +372,8 @@ class GreeterPerspective(Perspective):
     def __search_changed_cb(self, search_entry):
         search_hit = False
         search_text = search_entry.get_text().lower()
+        style_context = search_entry.get_style_context()
+
         for recent_project_item in self.__recent_projects_listbox.get_children():
             if search_text in recent_project_item.name.lower():
                 recent_project_item.show()
@@ -379,6 +381,11 @@ class GreeterPerspective(Perspective):
             else:
                 recent_project_item.hide()
 
+        if not search_hit:
+            style_context.add_class("error")
+        else:
+            style_context.remove_class("error")
+
         self.__recent_projects_labelbox.set_visible(search_hit)
         self.__recent_projects_listbox.set_visible(search_hit)
 


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