From fc8a4d6e16ce837efec6fc045e3438e0631bdc38 Mon Sep 17 00:00:00 2001
From: Xavier Jouslin de Noray <xavier.jouslindenoray@savoirfairelinux.com>
Date: Fri, 26 May 2023 12:07:52 -0400
Subject: [PATCH] settingssidepanel: fix re-selection in single pane mode

Gitlab: #1130
Change-Id: Icfe9efc69d69b69fbcc5c2224241f89e0b9ccca9
---
 src/app/commoncomponents/ListSelectionView.qml | 2 +-
 src/app/settingsview/SettingsSidePanel.qml     | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/app/commoncomponents/ListSelectionView.qml b/src/app/commoncomponents/ListSelectionView.qml
index 186d20f57..cdacb4649 100644
--- a/src/app/commoncomponents/ListSelectionView.qml
+++ b/src/app/commoncomponents/ListSelectionView.qml
@@ -45,7 +45,7 @@ DualPaneView {
     function selectIndex(index) { viewNode.index = index }
 
     // Override this predicate if needed.
-    property bool hasValidSelection: viewNode.index >= 0
+    property bool hasValidSelection: viewNode.index >= -1
     onHasValidSelectionChanged: isSinglePaneChangedHandler()
 
     // Override BaseView.dismiss with some selection logic.
diff --git a/src/app/settingsview/SettingsSidePanel.qml b/src/app/settingsview/SettingsSidePanel.qml
index a71baf030..416e42ba3 100644
--- a/src/app/settingsview/SettingsSidePanel.qml
+++ b/src/app/settingsview/SettingsSidePanel.qml
@@ -143,6 +143,7 @@ SidePanelBase {
     }
 
     function open(index) {
+        indexSelected(-1)
         indexSelected(index)
         root.currentIndex = index
     }
-- 
GitLab