[gnome-games/gnome-3-30] collection-box: Update filtering text on view change



commit 049836ec7e5bf7f8ce664aab09be6fe3ee51bf77
Author: Tony Crisci <tony dubstepdish com>
Date:   Thu Oct 4 19:41:15 2018 +0000

    collection-box: Update filtering text on view change
    
    When the active view of the CollectionBox changes, update the filtering
    text on the view to the current value of the search text box so it will
    filter entries correctly when it is shown.
    
    Fixes #124
    
    
    (cherry picked from commit f23208bd1f8592990dfd8f95cba0290c3365a65a)

 src/ui/collection-box.vala | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/ui/collection-box.vala b/src/ui/collection-box.vala
index de2c95c2..5e1117e3 100644
--- a/src/ui/collection-box.vala
+++ b/src/ui/collection-box.vala
@@ -143,12 +143,15 @@ private class Games.CollectionBox : Gtk.Box {
        [GtkCallback]
        private void on_visible_child_changed () {
                if (viewstack.visible_child == platform_view) {
+                       platform_view.filtering_text = search_bar.text;
                        platform_view.select_default_row ();
                }
                else if (viewstack.visible_child == developer_view) {
+                       developer_view.filtering_text = search_bar.text;
                        developer_view.select_default_row ();
                }
                else {
+                       collection_view.filtering_text = search_bar.text;
                        collection_view.reset_scroll_position ();
                }
        }


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