From 5d9508b1659c0d8afa036b7eb3f402e05731170d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jimmy=20Bergstr=C3=B6m?= Date: Wed, 17 Dec 2025 22:33:08 +0100 Subject: [PATCH] Hide quick format bar when selection is cleared I noticed a bit of an annoying behavior with the quick format bar. Whenever I make a typo when writing a message I usually go back with a ctrl+shift+arrow selection to correct it, and that of course triggers the bar, but then there wasn't any obvious way to make it go away (other than pressing backspace or delete, [ChatBar.qml#L339](https://invent.kde.org/network/neochat/-/blob/master/src/chatbar/ChatBar.qml?ref_type=heads#L339)), so it'd always be stuck visible until I clicked somewhere with my mouse, which I found somewhat annoying. This intends to fix that, by hiding it whenever the selection is cleared, which seems like a reasonable and expected behavior to me. I would also be okay with making it dismissable with escape, if this current suggestion has some unintended side-effect that I've missed. I also think that this should in practice "solve" this bug https://bugs.kde.org/show_bug.cgi?id=511590 but I didn't link it directly as their suggested solution is smarter placement of the bar. --- src/chatbar/ChatBar.qml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/chatbar/ChatBar.qml b/src/chatbar/ChatBar.qml index 2ef63afad..6e4c94043 100644 --- a/src/chatbar/ChatBar.qml +++ b/src/chatbar/ChatBar.qml @@ -286,6 +286,8 @@ QQC2.Control { quickFormatBar.selectionStart = selectionStart; quickFormatBar.selectionEnd = selectionEnd; quickFormatBar.open(); + } else if (quickFormatBar.visible) { + quickFormatBar.close(); } }