Skip to content

Commit

Permalink
fix apps menu not closing when the window is hidden, and make group f…
Browse files Browse the repository at this point in the history
…olders menu work again

this change resolves this ReferenceError when the window is being closed:
```
2025-01-08 10:56:40:389 [ warning default qrc:/qml/src/gui/tray/MainWindow.qml:100 ]:   qrc:/qml/src/gui/tray/MainWindow.qml:100: ReferenceError: appsMenu is not defined
```

I also noticed that the "Open local or group folders" dropdown menu
wouldn't show up due to this error:
```
2025-01-08 10:56:23:327 [ warning default qrc:/qml/src/gui/tray/TrayFoldersMenuButton.qml:33 ]: qrc:/qml/src/gui/tray/TrayFoldersMenuButton.qml:33: Error: Cannot call method QQuickPopup::open on QQuickLoader_QML_48(0x5569fb4648d0)
```
--> wrapped the calls to the open/close methods in a closure

Signed-off-by: Jyrki Gadinger <[email protected]>
  • Loading branch information
nilsding authored and backportbot[bot] committed Jan 8, 2025
1 parent 0d28846 commit 2f3dcb5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/gui/tray/MainWindow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ ApplicationWindow {

if (Systray.isOpen) {
trayWindowHeader.currentAccountHeaderButton.accountMenu.close();
appsMenu.close();
openLocalFolderButton.closeMenu()
trayWindowHeader.appsMenu.close();
trayWindowHeader.openLocalFolderButton.closeMenu()
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/gui/tray/TrayFoldersMenuButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ HeaderButton {
}

Component.onCompleted: {
foldersMenuLoader.openMenu = open
foldersMenuLoader.closeMenu = close
foldersMenuLoader.openMenu = function() { open() }
foldersMenuLoader.closeMenu = function() { close() }
}

Connections {
Expand Down
2 changes: 2 additions & 0 deletions src/gui/tray/TrayWindowHeader.qml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ Rectangle {
id: root

readonly property alias currentAccountHeaderButton: currentAccountHeaderButton
readonly property alias openLocalFolderButton: openLocalFolderButton
readonly property alias appsMenu: appsMenu

color: Style.currentUserHeaderColor

Expand Down

0 comments on commit 2f3dcb5

Please sign in to comment.