Fix dark mode switching issues with main tray window
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Tue, 23 May 2023 15:27:30 +0000 (23:27 +0800)
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>
Tue, 30 May 2023 08:40:51 +0000 (08:40 +0000)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
src/gui/filedetails/ShareDetailsPage.qml
src/gui/filedetails/ShareView.qml
src/gui/filedetails/ShareeSearchField.qml
src/gui/tray/ActivityItem.qml
src/gui/tray/ActivityList.qml
src/gui/tray/SyncStatus.qml
src/gui/tray/TrayFoldersMenuButton.qml
src/gui/tray/Window.qml
theme/Style/Style.qml

index 9b1d49ad0fbdd9470b499f73b18c3a37bec62fbd..8ef021527497d452e58624f1c85be596bcd369a7 100644 (file)
@@ -166,6 +166,9 @@ Page {
         text: Style.ncTextColor
         windowText: Style.ncTextColor
         buttonText: Style.ncTextColor
+        brightText: Style.ncTextBrightColor
+        highlight: Style.lightHover
+        highlightedText: Style.ncTextColor
         light: Style.lightHover
         midlight: Style.lightHover
         mid: Style.ncSecondaryTextColor
@@ -173,6 +176,8 @@ Page {
         button: Style.menuBorder
         window: Style.backgroundColor
         base: Style.backgroundColor
+        toolTipBase: Style.backgroundColor
+        toolTipText: Style.ncTextColor
     }
 
     background: Rectangle {
index 528936645f866a3205358b3e87901117ba38de50..07d8c90b8fd47059278aaa0e3eef0df3020da123 100644 (file)
@@ -99,6 +99,9 @@ ColumnLayout {
             text: Style.ncTextColor
             windowText: Style.ncTextColor
             buttonText: Style.ncTextColor
+            brightText: Style.ncTextBrightColor
+            highlight: Style.lightHover
+            highlightedText: Style.ncTextColor
             light: Style.lightHover
             midlight: Style.lightHover
             mid: Style.ncSecondaryTextColor
@@ -106,6 +109,8 @@ ColumnLayout {
             button: Style.menuBorder
             window: Style.backgroundColor
             base: Style.backgroundColor
+            toolTipBase: Style.backgroundColor
+            toolTipText: Style.ncTextColor
         }
 
         visible: false
index c3dd9873100e26fffed32a4f476032464823266d..0f24c2c414cd92c74682db13db25e6c491f1ab5d 100644 (file)
@@ -178,6 +178,9 @@ TextField {
             text: Style.ncTextColor
             windowText: Style.ncTextColor
             buttonText: Style.ncTextColor
+            brightText: Style.ncTextBrightColor
+            highlight: Style.lightHover
+            highlightedText: Style.ncTextColor
             light: Style.lightHover
             midlight: Style.lightHover
             mid: Style.ncSecondaryTextColor
@@ -185,6 +188,8 @@ TextField {
             button: Style.menuBorder
             window: Style.backgroundColor
             base: Style.backgroundColor
+            toolTipBase: Style.backgroundColor
+            toolTipText: Style.ncTextColor
         }
 
         contentItem: ScrollView {
index 2cac0580b9798a75d283be507fdcabe01e3748dc..88ff4047240768afbe2467e42de02b6e86638af0 100644 (file)
@@ -18,6 +18,26 @@ ItemDelegate {
     readonly property bool isTalkReplyPossible: model.conversationToken !== ""
     property bool isTalkReplyOptionVisible: model.messageSent !== ""
 
+    // TODO: Rather than setting all these palette colours manually,
+    // create a custom style and do it for all components globally
+    palette {
+        text: Style.ncTextColor
+        windowText: Style.ncTextColor
+        buttonText: Style.ncTextColor
+        brightText: Style.ncTextBrightColor
+        highlight: Style.lightHover
+        highlightedText: Style.ncTextColor
+        light: Style.lightHover
+        midlight: Style.lightHover
+        mid: Style.ncSecondaryTextColor
+        dark: Style.menuBorder
+        button: Style.menuBorder
+        window: Style.backgroundColor
+        base: Style.backgroundColor
+        toolTipBase: Style.backgroundColor
+        toolTipText: Style.ncTextColor
+    }
+
     padding: Style.standardSpacing
 
     Accessible.role: Accessible.ListItem
index 436a79e5bd6c6dc1adc5dc3809f426f66d54b0d5..67943f3af5762bdc88726f97a2355ea80c70bc4c 100644 (file)
@@ -14,6 +14,26 @@ ScrollView {
     signal openFile(string filePath)
     signal activityItemClicked(int index)
 
+    // TODO: Rather than setting all these palette colours manually,
+    // create a custom style and do it for all components globally
+    palette {
+        text: Style.ncTextColor
+        windowText: Style.ncTextColor
+        buttonText: Style.ncTextColor
+        brightText: Style.ncTextBrightColor
+        highlight: Style.lightHover
+        highlightedText: Style.ncTextColor
+        light: Style.lightHover
+        midlight: Style.lightHover
+        mid: Style.ncSecondaryTextColor
+        dark: Style.menuBorder
+        button: Style.menuBorder
+        window: Style.backgroundColor
+        base: Style.backgroundColor
+        toolTipBase: Style.backgroundColor
+        toolTipText: Style.ncTextColor
+    }
+
     contentWidth: availableWidth
     padding: 0
     focus: false
index fccf41cd39e227b25d71facbf008684d273da2e1..deb48116143839ff0def4c0791bfa0d0ce015076 100644 (file)
@@ -75,6 +75,9 @@ RowLayout {
                     text: Style.ncTextColor
                     windowText: Style.ncTextColor
                     buttonText: Style.ncTextColor
+                    brightText: Style.ncTextBrightColor
+                    highlight: Style.lightHover
+                    highlightedText: Style.ncTextColor
                     light: Style.lightHover
                     midlight: Style.lightHover
                     mid: Style.ncSecondaryTextColor
@@ -82,6 +85,8 @@ RowLayout {
                     button: Style.menuBorder
                     window: Style.backgroundColor
                     base: Style.backgroundColor
+                    toolTipBase: Style.backgroundColor
+                    toolTipText: Style.ncTextColor
                 }
 
                 value: syncStatus.syncProgress
index f267f61ee151105fdd0607004de340441859ce80..79cf4a1cd24565353b67e93940eb338d203fca25 100644 (file)
@@ -44,7 +44,6 @@ HeaderButton {
     visible: currentUser.hasLocalFolder
     display: AbstractButton.IconOnly
     flat: true
-    palette: Style.systemPalette
 
     Accessible.role: root.userHasGroupFolders ? Accessible.ButtonMenu : Accessible.Button
     Accessible.name: tooltip.text
index 03d592e765b9f99f567029e3dd5579e5e3345fc8..4e347a2f8c75c9113c040856d80c680226b2bd02 100644 (file)
@@ -257,7 +257,6 @@ ApplicationWindow {
                     Layout.preferredHeight: Style.trayWindowHeaderHeight\r
                     display:                AbstractButton.IconOnly\r
                     flat:                   true\r
-                    palette: Style.systemPalette\r
 \r
                     Accessible.role: Accessible.ButtonMenu\r
                     Accessible.name: qsTr("Current account")\r
@@ -285,7 +284,26 @@ ApplicationWindow {
                         width: (Style.currentAccountButtonWidth - 2)\r
                         height: Math.min(implicitHeight, maxMenuHeight)\r
                         closePolicy: Menu.CloseOnPressOutsideParent | Menu.CloseOnEscape\r
-                        palette: Style.palette\r
+\r
+                        // TODO: Rather than setting all these palette colours manually,\r
+                        // create a custom style and do it for all components globally\r
+                        palette {\r
+                            text: Style.ncTextColor\r
+                            windowText: Style.ncTextColor\r
+                            buttonText: Style.ncTextColor\r
+                            brightText: Style.ncTextBrightColor\r
+                            highlight: Style.lightHover\r
+                            highlightedText: Style.ncTextColor\r
+                            light: Style.lightHover\r
+                            midlight: Style.lightHover\r
+                            mid: Style.ncSecondaryTextColor\r
+                            dark: Style.menuBorder\r
+                            button: Style.menuBorder\r
+                            window: Style.backgroundColor\r
+                            base: Style.backgroundColor\r
+                            toolTipBase: Style.backgroundColor\r
+                            toolTipText: Style.ncTextColor\r
+                        }\r
 \r
                         background: Rectangle {\r
                             border.color: Style.menuBorder\r
@@ -334,7 +352,6 @@ ApplicationWindow {
                             id: addAccountButton\r
                             height: Style.addAccountButtonHeight\r
                             hoverEnabled: true\r
-                            palette: Theme.systemPalette\r
 \r
                             background: Item {\r
                                 height: parent.height\r
@@ -386,7 +403,6 @@ ApplicationWindow {
                         MenuItem {\r
                             id: syncPauseButton\r
                             font.pixelSize: Style.topLinePixelSize\r
-                            palette.windowText: Style.ncTextColor\r
                             hoverEnabled: true\r
                             onClicked: Systray.syncIsPaused = !Systray.syncIsPaused\r
 \r
@@ -409,7 +425,6 @@ ApplicationWindow {
                             id: settingsButton\r
                             text: qsTr("Settings")\r
                             font.pixelSize: Style.topLinePixelSize\r
-                            palette.windowText: Style.ncTextColor\r
                             hoverEnabled: true\r
                             onClicked: Systray.openSettings()\r
 \r
@@ -432,7 +447,6 @@ ApplicationWindow {
                             id: exitButton\r
                             text: qsTr("Exit");\r
                             font.pixelSize: Style.topLinePixelSize\r
-                            palette.windowText: Style.ncTextColor\r
                             hoverEnabled: true\r
                             onClicked: Systray.shutdown()\r
 \r
@@ -655,6 +669,26 @@ ApplicationWindow {
                         height: implicitHeight + y > Style.trayWindowHeight ? Style.trayWindowHeight - y : implicitHeight\r
                         closePolicy: Menu.CloseOnPressOutsideParent | Menu.CloseOnEscape\r
 \r
+                        // TODO: Rather than setting all these palette colours manually,\r
+                        // create a custom style and do it for all components globally\r
+                        palette {\r
+                            text: Style.ncTextColor\r
+                            windowText: Style.ncTextColor\r
+                            buttonText: Style.ncTextColor\r
+                            brightText: Style.ncTextBrightColor\r
+                            highlight: Style.lightHover\r
+                            highlightedText: Style.ncTextColor\r
+                            light: Style.lightHover\r
+                            midlight: Style.lightHover\r
+                            mid: Style.ncSecondaryTextColor\r
+                            dark: Style.menuBorder\r
+                            button: Style.menuBorder\r
+                            window: Style.backgroundColor\r
+                            base: Style.backgroundColor\r
+                            toolTipBase: Style.backgroundColor\r
+                            toolTipText: Style.ncTextColor\r
+                        }\r
+\r
                         background: Rectangle {\r
                             border.color: Style.menuBorder\r
                             color: Style.backgroundColor\r
@@ -682,7 +716,6 @@ ApplicationWindow {
 \r
                                     text: model.appName\r
                                     font.pixelSize: Style.topLinePixelSize\r
-                                    palette.windowText: Style.ncTextColor\r
                                     icon.source: model.appIconUrl\r
                                     icon.color: Style.ncTextColor\r
                                     onTriggered: UserAppsModel.openAppUrl(appUrl)\r
index d16a6b821eb6b4bd5c79c741842d97e8aefea565..9a7a69f488d34145ab36500701b9aa8454d6f3ca 100644 (file)
@@ -11,6 +11,7 @@ QtObject {
     // Colors\r
     readonly property color ncBlue:      Theme.wizardHeaderBackgroundColor\r
     readonly property color ncTextColor: Theme.systemPalette.windowText\r
+    readonly property color ncTextBrightColor: "white"\r
     readonly property color ncSecondaryTextColor: "#808080"\r
     readonly property color ncHeaderTextColor: "white"\r
     readonly property color lightHover: Theme.darkMode ? Qt.lighter(backgroundColor, 2) : Qt.darker(backgroundColor, 1.05)\r