From fb2a165c3f7f2d6bb9ba2b1736e764189e89df37 Mon Sep 17 00:00:00 2001 From: Mauro Mura Date: Fri, 12 Jul 2024 11:39:22 +0200 Subject: [PATCH] changes to main window --- .gitignore | 3 +++ src/gui/main.cpp | 12 ++++++++++++ src/gui/tray/Window.qml | 16 ++++++++++++++++ 3 files changed, 31 insertions(+) diff --git a/.gitignore b/.gitignore index 85a87ed91464..ceea196245ae 100644 --- a/.gitignore +++ b/.gitignore @@ -190,3 +190,6 @@ convert.exe *-w10startmenu.png *state-*.png theme.qrc + +# Ignore specific folders +shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/ \ No newline at end of file diff --git a/src/gui/main.cpp b/src/gui/main.cpp index 6742a8b1a0e5..6bf132bd1225 100644 --- a/src/gui/main.cpp +++ b/src/gui/main.cpp @@ -58,6 +58,18 @@ int main(int argc, char **argv) #ifdef Q_OS_WIN SetDllDirectory(L""); #endif + + bool resourceLoaded = false; + const QString currentPath = QDir::currentPath(); + if(Utility::isMac()) + { + resourceLoaded = QResource::registerResource(QDir::toNativeSeparators("/Applications/MagentaCLOUD.app/Contents/Resources/nmctheme_v1.rcc")); + } + else if(Utility::isWindows() || !resourceLoaded) + { + resourceLoaded = QResource::registerResource(QDir::toNativeSeparators(currentPath + "/nmctheme_v1.rcc")); + } + Q_INIT_RESOURCE(resources); Q_INIT_RESOURCE(theme); diff --git a/src/gui/tray/Window.qml b/src/gui/tray/Window.qml index 9806ff6cb5ef..e7560cb3b238 100644 --- a/src/gui/tray/Window.qml +++ b/src/gui/tray/Window.qml @@ -351,6 +351,22 @@ ApplicationWindow { } } + contentItem: ScrollView { + id: accMenuScrollView + ScrollBar.horizontal.policy: ScrollBar.AlwaysOff + + data: WheelHandler { + target: accMenuScrollView.contentItem + } + ListView { + implicitHeight: contentHeight + model: accountMenu.contentModel + interactive: true + clip: true + currentIndex: accountMenu.currentIndex + } + } + onClosed: { // HACK: reload account Instantiator immediately by restting it - could be done better I guess // see also onVisibleChanged above