From e8dbb743da0acf9b3de74cdcd888683afcfc1e6f Mon Sep 17 00:00:00 2001 From: Jyrki Gadinger Date: Fri, 3 Jan 2025 11:14:48 +0100 Subject: [PATCH] Remove transparency value from system colours where needed For some reason Windows11 has some transparency in the system colours which makes reading drawers difficult Signed-off-by: Jyrki Gadinger --- src/gui/tray/MainWindow.qml | 6 +++--- theme/Style/Style.qml | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/gui/tray/MainWindow.qml b/src/gui/tray/MainWindow.qml index a16b351ae8f70..cf13b90be918b 100644 --- a/src/gui/tray/MainWindow.qml +++ b/src/gui/tray/MainWindow.qml @@ -143,7 +143,7 @@ ApplicationWindow { radius: Systray.useNormalWindow ? 0.0 : Style.trayWindowRadius border.width: Style.trayWindowBorderWidth border.color: palette.dark - color: palette.base + color: Style.colorWithoutTransparency(palette.base) } property int userIndex: 0 @@ -180,7 +180,7 @@ ApplicationWindow { radius: Systray.useNormalWindow ? 0.0 : Style.trayWindowRadius border.width: Style.trayWindowBorderWidth border.color: palette.dark - color: palette.base + color: Style.colorWithoutTransparency(palette.base) } property var folderAccountState: ({}) @@ -239,7 +239,7 @@ ApplicationWindow { clip: true radius: Systray.useNormalWindow ? 0.0 : Style.trayWindowRadius - color: palette.base + color: Style.colorWithoutTransparency(palette.base) Accessible.role: Accessible.Grouping Accessible.name: qsTr("Nextcloud desktop main dialog") diff --git a/theme/Style/Style.qml b/theme/Style/Style.qml index 014fa5a07690f..03c7bf932fcd7 100644 --- a/theme/Style/Style.qml +++ b/theme/Style/Style.qml @@ -200,4 +200,9 @@ QtObject { function variableSize(size) { return size * (1 + Math.min(pixelSize / 100, 1)); } + + // some platforms (e.g. Windows 11) have a transparency set on palette colours, this function removes that + function colorWithoutTransparency(color) { + return Qt.rgba(color.r, color.g, color.b, 1) + } }