Focus text field on key press (swallows first though...)

pull/1246/head
Nicolas Werner 2 years ago
parent 593d08fd2e
commit 8730586cfd
No known key found for this signature in database
GPG Key ID: C8D75E610773F2D9
  1. 2
      resources/qml/TimelineView.qml
  2. 3
      resources/qml/TopBar.qml

@ -28,6 +28,8 @@ Item {
onRoomChanged: if (room != null) room.triggerSpecialEffects()
Keys.onPressed: if (!topBar.searchHasFocus) TimelineManager.focusMessageInput();
Shortcut {
sequence: StandardKey.Close
onActivated: Rooms.resetCurrentRoom()

@ -25,6 +25,8 @@ Pane {
property bool isDirect: room ? room.isDirect : false
property string directChatOtherUserId: room ? room.directChatOtherUserId : ""
property bool searchHasFocus: searchField.focus && searchField.enabled
property string searchString: ""
onRoomIdChanged: {
@ -447,6 +449,7 @@ Pane {
MatrixTextField {
id: searchField
visible: searchButton.searchActive
enabled: visible
Layout.row: 5
Layout.column: 2

Loading…
Cancel
Save