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:
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user