update tab indices properly when manipulating tab count
This commit is contained in:
parent
d9f9f30257
commit
798967b48f
@ -27,12 +27,21 @@ Item {
|
||||
function addTab() {
|
||||
tabModel.append({})
|
||||
settings.tabCount++;
|
||||
swipeView.currentIndex = settings.tabCount - 1
|
||||
tabbar.currentIndex = swipeView.currentIndex
|
||||
}
|
||||
function removeTab(index) {
|
||||
remove(index);
|
||||
settings.tabCount--;
|
||||
tabbar.currentIndex = swipeView.currentIndex
|
||||
orphanedSettings.lastConnectedHost = ""
|
||||
}
|
||||
}
|
||||
Settings {
|
||||
id: orphanedSettings
|
||||
category: "tabSettings" + tabModel.count
|
||||
property string lastConnectedHost
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
@ -55,8 +64,7 @@ Item {
|
||||
objectName: "pageStack"
|
||||
initialItem: Page {}
|
||||
|
||||
Settings {
|
||||
id: tabSettings
|
||||
property var tabSettings: Settings {
|
||||
category: "tabSettings" + index
|
||||
property string lastConnectedHost
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user