diff --git a/TODO.md b/TODO.md index c8c75a95..acdc2aba 100644 --- a/TODO.md +++ b/TODO.md @@ -1,13 +1,12 @@ - Refactoring - Migrate more JS functions to their own files / Implement in Python instead - Don't bake in size properties for components + - Cleanup unused icons - Bug fixes - - Sendbox - 100% CPU usage when hitting top edge to trigger messages loading - Sending `![A picture](https://picsum.photos/256/256)` → not clickable? - - Icons and images aren't reloaded - - HStyle singleton isn't reloaded + - Icons, images and HStyle singleton aren't reloaded - `MessageDelegate.qml:63: TypeError: 'reloadPreviousItem' not a function` - UI diff --git a/harmonyqml/components/Base/HScrollableTextArea.qml b/harmonyqml/components/Base/HScrollableTextArea.qml index 52d1ebb2..9e399ab3 100644 --- a/harmonyqml/components/Base/HScrollableTextArea.qml +++ b/harmonyqml/components/Base/HScrollableTextArea.qml @@ -9,6 +9,7 @@ ScrollView { default property alias textAreaData: textArea.data + id: scrollView clip: true TextArea { @@ -25,6 +26,8 @@ ScrollView { id: textAreaBackground color: HStyle.controls.textArea.background } + + Keys.forwardTo: [scrollView] } } diff --git a/harmonyqml/components/Chat/SendBox.qml b/harmonyqml/components/Chat/SendBox.qml index b11da084..7b33bd1d 100644 --- a/harmonyqml/components/Chat/SendBox.qml +++ b/harmonyqml/components/Chat/SendBox.qml @@ -40,6 +40,7 @@ HGlassRectangle { area.onEditingFinished: setTyping(false) // when lost focus Keys.onReturnPressed: { + console.log( "enter") event.accepted = true if (event.modifiers & Qt.ShiftModifier || @@ -52,10 +53,11 @@ HGlassRectangle { if (textArea.text === "") { return } Backend.clients.get(chatPage.userId) .sendMarkdown(chatPage.roomId, textArea.text) - textArea.clear() + area.clear() } - Keys.onEnterPressed: Keys.onReturnPressed(event) // numpad enter + // Numpad enter + Keys.onEnterPressed: Keys.onReturnPressed(event) } } }