Fix back/forward headers buttons in small window

This commit is contained in:
miruka 2020-05-10 17:46:52 -04:00
parent 05325d21bd
commit b4561ce50b
3 changed files with 14 additions and 11 deletions

View File

@ -26,7 +26,7 @@ Rectangle {
icon.name: "go-back-to-main-pane" icon.name: "go-back-to-main-pane"
toolTip.text: qsTr("Go back to main pane") toolTip.text: qsTr("Go back to main pane")
onClicked: mainUI.mainPane.toggleFocus() onClicked: mainUI.mainPane.filterRoomsField.toggleFocus()
Layout.preferredWidth: theme.baseElementsHeight Layout.preferredWidth: theme.baseElementsHeight
Layout.fillHeight: true Layout.fillHeight: true

View File

@ -33,6 +33,17 @@ HTextField {
property RoomList roomList property RoomList roomList
function toggleFocus() {
if (filterField.activeFocus) {
pageLoader.takeFocus()
return
}
mainPane.open()
filterField.forceActiveFocus()
}
Behavior on opacity { HNumberAnimation {} } Behavior on opacity { HNumberAnimation {} }
HShortcut { HShortcut {
@ -42,14 +53,6 @@ HTextField {
HShortcut { HShortcut {
sequences: window.settings.keys.toggleFocusMainPane sequences: window.settings.keys.toggleFocusMainPane
onActivated: { onActivated: toggleFocus()
if (filterField.activeFocus) {
pageLoader.takeFocus()
return
}
mainPane.open()
filterField.forceActiveFocus()
}
} }
} }

View File

@ -34,7 +34,7 @@ Rectangle {
icon.name: "go-back-to-main-pane" icon.name: "go-back-to-main-pane"
toolTip.text: qsTr("Go back to main pane") toolTip.text: qsTr("Go back to main pane")
onClicked: mainUI.mainPane.toggleFocus() onClicked: mainUI.mainPane.filterRoomsField.toggleFocus()
Layout.preferredWidth: showPaneButtons ? avatar.width : 0 Layout.preferredWidth: showPaneButtons ? avatar.width : 0
Layout.fillHeight: true Layout.fillHeight: true