1
0
mirror of https://github.com/Swordfish90/cool-retro-term.git synced 2026-02-08 00:32:27 +00:00

Make sure focus is always taken when the current tab changes.

This commit is contained in:
Filippo Scognamiglio
2026-01-08 10:29:33 +01:00
parent 0bec01bfb4
commit e9c818242e

View File

@@ -104,11 +104,15 @@ Item {
Repeater {
model: tabsModel
onItemAdded: function(index, item) {
if (index === tabBar.currentIndex)
item.activate()
}
TerminalContainer {
property bool isCurrentItem: StackLayout.isCurrentItem
onIsCurrentItemChanged: {
if (isCurrentItem) {
activate()
}
}
Layout.fillWidth: true
Layout.fillHeight: true
onTitleChanged: tabsModel.setProperty(index, "title", title)
@@ -117,12 +121,4 @@ Item {
}
}
}
Connections {
target: tabBar
onCurrentIndexChanged: {
if (stack.currentItem)
stack.currentItem.activate()
}
}
}