uiux(Chat): ensure chat input gets focus when changing views and channels
Fixes #804
This commit is contained in:
parent
2c9d042152
commit
bc7b825f55
|
@ -19,6 +19,15 @@ StackLayout {
|
|||
property bool isConnected: false
|
||||
property string contactToRemove: ""
|
||||
|
||||
property var onActivated: function () {
|
||||
chatInput.textInput.forceActiveFocus(Qt.MouseFocusReason)
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
chatInput.textInput.forceActiveFocus(Qt.MouseFocusReason)
|
||||
}
|
||||
|
||||
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
Layout.minimumWidth: 300
|
||||
|
@ -175,6 +184,7 @@ StackLayout {
|
|||
Connections {
|
||||
target: chatsModel
|
||||
onActiveChannelChanged: {
|
||||
chatInput.textInput.forceActiveFocus(Qt.MouseFocusReason)
|
||||
suggestions.clear()
|
||||
for (let i = 0; i < chatsModel.suggestionList.rowCount(); i++) {
|
||||
suggestions.append({
|
||||
|
|
|
@ -9,6 +9,10 @@ SplitView {
|
|||
id: chatView
|
||||
handle: SplitViewHandle {}
|
||||
|
||||
property var onActivated: function () {
|
||||
chatColumn.onActivated()
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: applicationWindow
|
||||
onSettingsLoaded: {
|
||||
|
|
|
@ -191,6 +191,11 @@ RowLayout {
|
|||
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
|
||||
Layout.fillHeight: true
|
||||
currentIndex: tabBar.currentIndex
|
||||
onCurrentIndexChanged: {
|
||||
if (typeof this.children[currentIndex].onActivated === "function") {
|
||||
this.children[currentIndex].onActivated()
|
||||
}
|
||||
}
|
||||
|
||||
ChatLayout {
|
||||
id: chatLayoutContainer
|
||||
|
|
Loading…
Reference in New Issue