mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 19:08:58 +03:00
Autoclose completer when space is pressed and no suggestion available
This commit is contained in:
parent
498bfb89b3
commit
d1280af2e4
3 changed files with 5 additions and 1 deletions
|
@ -11,6 +11,7 @@ Popup {
|
||||||
property string completerName
|
property string completerName
|
||||||
property var completer
|
property var completer
|
||||||
property bool bottomToTop: true
|
property bool bottomToTop: true
|
||||||
|
property alias count: listView.count
|
||||||
|
|
||||||
signal completionClicked(string completion)
|
signal completionClicked(string completion)
|
||||||
|
|
||||||
|
|
|
@ -162,6 +162,9 @@ Rectangle {
|
||||||
if (event.matches(StandardKey.Paste)) {
|
if (event.matches(StandardKey.Paste)) {
|
||||||
TimelineManager.timeline.input.paste(false);
|
TimelineManager.timeline.input.paste(false);
|
||||||
event.accepted = true;
|
event.accepted = true;
|
||||||
|
} else if (event.key == Qt.Key_Space) {
|
||||||
|
if (popup.opened && popup.count <= 0)
|
||||||
|
popup.close()
|
||||||
} else if (event.modifiers == Qt.ControlModifier && event.key == Qt.Key_U) {
|
} else if (event.modifiers == Qt.ControlModifier && event.key == Qt.Key_U) {
|
||||||
messageInput.clear();
|
messageInput.clear();
|
||||||
} else if (event.modifiers == Qt.ControlModifier && event.key == Qt.Key_P) {
|
} else if (event.modifiers == Qt.ControlModifier && event.key == Qt.Key_P) {
|
||||||
|
|
|
@ -35,7 +35,7 @@ Page {
|
||||||
colors: palette
|
colors: palette
|
||||||
|
|
||||||
model: EmojiProxyModel {
|
model: EmojiProxyModel {
|
||||||
category: EmojiCategory.People
|
category: Emoji.Category.People
|
||||||
|
|
||||||
sourceModel: EmojiModel {
|
sourceModel: EmojiModel {
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue