[gnome-characters/bilelmoussaoui/unfold] sidebar: unselect row if folded




commit edda69a87605e3a1f6280db61ce36830fab9fab6
Author: Bilal Elmoussaoui <belmouss redhat com>
Date:   Thu Jan 27 18:15:15 2022 +0100

    sidebar: unselect row if folded
    
    Fixes #95

 src/sidebar.js | 4 ++++
 src/window.js  | 5 ++++-
 2 files changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/src/sidebar.js b/src/sidebar.js
index 0d0d80c..0d586e7 100644
--- a/src/sidebar.js
+++ b/src/sidebar.js
@@ -92,6 +92,10 @@ var Sidebar = GObject.registerClass({
         this._list.select_row(row);
     }
 
+    unselectAll() {
+        this._list.unselect_all();
+    }
+
     get list() {
         return this._list;
     }
diff --git a/src/window.js b/src/window.js
index 6e72d93..1557040 100644
--- a/src/window.js
+++ b/src/window.js
@@ -116,6 +116,9 @@ var MainWindow = GObject.registerClass({
 
         this._back_button.connect('clicked', () => {
             this._leaflet.navigate(Adw.NavigationDirection.BACK);
+            if (this._leaflet.get_folded()) {
+                this._sidebar.unselectAll();
+            }
         });
 
         this._charactersView.connect('notify::loading', view => {
@@ -146,7 +149,7 @@ var MainWindow = GObject.registerClass({
 
     set searchActive(v) {
         if (v) {
-            this._sidebar.list.unselect_all();
+            this._sidebar.unselectAll();
             this._windowTitle.title = _('Search Result');
         } else {
             this._sidebar.restoreSelection();


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