fix last active index

This commit is contained in:
Gaelle Braud 2025-01-14 14:55:23 +01:00
parent 81dfce3898
commit 39564ed708

View file

@ -117,6 +117,7 @@ Item {
Layout.fillHeight: true Layout.fillHeight: true
Layout.preferredWidth: 82 * DefaultStyle.dp Layout.preferredWidth: 82 * DefaultStyle.dp
defaultAccount: accountProxy.defaultAccount defaultAccount: accountProxy.defaultAccount
currentIndex: 0
Binding on currentIndex { Binding on currentIndex {
when: mainItem.contextualMenuOpenedComponent != undefined when: mainItem.contextualMenuOpenedComponent != undefined
value: -1 value: -1
@ -489,11 +490,13 @@ Item {
currentIndex: -1 currentIndex: -1
onActiveFocusChanged: if(activeFocus && currentIndex >= 0) children[currentIndex].forceActiveFocus() onActiveFocusChanged: if(activeFocus && currentIndex >= 0) children[currentIndex].forceActiveFocus()
on_CurrentIndexChanged:{ on_CurrentIndexChanged:{
if(count > 0 && _currentIndex >= count && tabbar.model[_currentIndex].link){ if (count > 0) {
Qt.openUrlExternally(tabbar.model[_currentIndex].link) if(_currentIndex >= count && tabbar.model[_currentIndex].link){
}else { Qt.openUrlExternally(tabbar.model[_currentIndex].link)
currentIndex = _currentIndex }else if (_currentIndex >= 0){
SettingsCpp.setLastActiveTabIndex(currentIndex) currentIndex = _currentIndex
SettingsCpp.setLastActiveTabIndex(currentIndex)
}
} }
} }
CallPage { CallPage {