summary refs log tree commit diff
path: root/resources
diff options
context:
space:
mode:
authorShootingStarDragons <ShootingStarDragons@protonmail.com>2023-01-23 20:15:43 +0800
committerShootingStarDragons <ShootingStarDragons@protonmail.com>2023-01-23 20:15:43 +0800
commit7d95ac23cecdec48b3c84a42afdfbed5b6d870a8 (patch)
treec48f00798c50a6b2a07a695b0bb1bf4fb18e0daf /resources
parentWarn when no secret can be requested (diff)
downloadnheko-7d95ac23cecdec48b3c84a42afdfbed5b6d870a8.tar.xz
feat: hide all popup menus when press leftbutton on somewhere else
Log: according to the bug on https://bugreports.qt.io/browse/QTBUG-83972, The menu will always stay if not click one of the item. So I try to make a hack for it, wait qt solve it someday
Diffstat (limited to 'resources')
-rw-r--r--resources/qml/MessageView.qml8
-rw-r--r--resources/qml/RoomList.qml9
-rw-r--r--resources/qml/TopBar.qml8
3 files changed, 25 insertions, 0 deletions
diff --git a/resources/qml/MessageView.qml b/resources/qml/MessageView.qml

index 6d5ee404..f8c65a8d 100644 --- a/resources/qml/MessageView.qml +++ b/resources/qml/MessageView.qml
@@ -25,6 +25,14 @@ Item { property string searchString: "" + // HACK: https://bugreports.qt.io/browse/QTBUG-83972, qtwayland cannot auto hide menu + Connections { + function onHideMenu() { + messageContextMenu.close() + } + target: MainWindow + } + ScrollBar { id: scrollbar parent: chat.parent diff --git a/resources/qml/RoomList.qml b/resources/qml/RoomList.qml
index 40ecdd34..348d104f 100644 --- a/resources/qml/RoomList.qml +++ b/resources/qml/RoomList.qml
@@ -20,6 +20,15 @@ Page { property int avatarSize: Math.ceil(fontMetrics.lineSpacing * 2.3) property bool collapsed: false + // HACK: https://bugreports.qt.io/browse/QTBUG-83972, qtwayland cannot auto hide menu + Connections { + function onHideMenu() { + userInfoMenu.close() + roomContextMenu.close() + } + target: MainWindow + } + Component { id: roomDirectoryComponent diff --git a/resources/qml/TopBar.qml b/resources/qml/TopBar.qml
index 4a52d234..23a7f149 100644 --- a/resources/qml/TopBar.qml +++ b/resources/qml/TopBar.qml
@@ -30,6 +30,14 @@ Pane { property string searchString: "" + // HACK: https://bugreports.qt.io/browse/QTBUG-83972, qtwayland cannot auto hide menu + Connections { + function onHideMenu() { + roomOptionsMenu.close() + } + target: MainWindow + } + onRoomIdChanged: { searchString = ""; searchButton.searchActive = false;