From 39564ed7080b97a3083de277a3895ce610c59b1d Mon Sep 17 00:00:00 2001 From: Gaelle Braud Date: Tue, 14 Jan 2025 14:55:23 +0100 Subject: [PATCH] fix last active index --- Linphone/view/Page/Layout/Main/MainLayout.qml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Linphone/view/Page/Layout/Main/MainLayout.qml b/Linphone/view/Page/Layout/Main/MainLayout.qml index 23f5c920..c09aa63d 100644 --- a/Linphone/view/Page/Layout/Main/MainLayout.qml +++ b/Linphone/view/Page/Layout/Main/MainLayout.qml @@ -117,6 +117,7 @@ Item { Layout.fillHeight: true Layout.preferredWidth: 82 * DefaultStyle.dp defaultAccount: accountProxy.defaultAccount + currentIndex: 0 Binding on currentIndex { when: mainItem.contextualMenuOpenedComponent != undefined value: -1 @@ -489,11 +490,13 @@ Item { currentIndex: -1 onActiveFocusChanged: if(activeFocus && currentIndex >= 0) children[currentIndex].forceActiveFocus() on_CurrentIndexChanged:{ - if(count > 0 && _currentIndex >= count && tabbar.model[_currentIndex].link){ - Qt.openUrlExternally(tabbar.model[_currentIndex].link) - }else { - currentIndex = _currentIndex - SettingsCpp.setLastActiveTabIndex(currentIndex) + if (count > 0) { + if(_currentIndex >= count && tabbar.model[_currentIndex].link){ + Qt.openUrlExternally(tabbar.model[_currentIndex].link) + }else if (_currentIndex >= 0){ + currentIndex = _currentIndex + SettingsCpp.setLastActiveTabIndex(currentIndex) + } } } CallPage {