remove any use of custom palette: use the style palette
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Wed, 7 Aug 2024 19:30:39 +0000 (21:30 +0200)
committerMatthieu Gallien <matthieu_gallien@yahoo.fr>
Fri, 6 Sep 2024 08:42:08 +0000 (10:42 +0200)
should get us native colors as much as possible

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
src/gui/ConflictItemFileInfo.qml
src/gui/ResolveConflictsDialog.qml
src/gui/filedetails/FileDetailsWindow.qml
src/gui/filedetails/ShareDetailsPage.qml
src/gui/macOS/ui/FileProviderSettings.qml
src/gui/tray/CallNotificationDialog.qml
src/gui/tray/EditFileLocallyLoadingDialog.qml
src/gui/tray/UserLine.qml
src/gui/tray/Window.qml

index 7a706f7b7fc022b01690fbf93a46df24be68b758..be345f7e8a9455de30c7aa03e72f3a16db708edd 100644 (file)
@@ -31,24 +31,6 @@ Item {
     CheckBox {
         id: selectItem
 
-        palette {
-            text: Style.ncTextColor
-            windowText: Style.ncTextColor
-            buttonText: Style.ncTextColor
-            brightText: Style.ncTextBrightColor
-            highlight: Style.lightHover
-            highlightedText: Style.ncTextColor
-            light: Style.lightHover
-            midlight: Style.ncSecondaryTextColor
-            mid: Style.darkerHover
-            dark: Style.menuBorder
-            button: Style.buttonBackgroundColor
-            window: palette.dark // NOTE: Fusion theme uses darker window colour for the border of the checkbox
-            base: Style.backgroundColor
-            toolTipBase: Style.backgroundColor
-            toolTipText: Style.ncTextColor
-        }
-
         anchors.left: parent.left
         anchors.verticalCenter: parent.verticalCenter
 
index 285bd8c038a2716228a069228b2e0d087914d263..485d874ebb37b9fa6c47a64a8c6883788a43c394 100644 (file)
@@ -36,26 +36,6 @@ ApplicationWindow {
     minimumHeight: Style.minimumHeightResolveConflictsDialog
     title: qsTr('Solve sync conflicts')
 
-    // 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.ncSecondaryTextColor
-        mid: Style.darkerHover
-        dark: Style.menuBorder
-        button: Style.buttonBackgroundColor
-        window: Style.backgroundColor
-        base: Style.backgroundColor
-        toolTipBase: Style.backgroundColor
-        toolTipText: Style.ncTextColor
-    }
-
     onClosing: function(close) {
         Systray.destroyDialog(self);
         close.accepted = true
@@ -94,24 +74,6 @@ ApplicationWindow {
 
                 Layout.fillWidth: true
 
-                palette {
-                    text: Style.ncTextColor
-                    windowText: Style.ncTextColor
-                    buttonText: Style.ncTextColor
-                    brightText: Style.ncTextBrightColor
-                    highlight: Style.lightHover
-                    highlightedText: Style.ncTextColor
-                    light: Style.lightHover
-                    midlight: Style.ncSecondaryTextColor
-                    mid: Style.darkerHover
-                    dark: Style.menuBorder
-                    button: Style.buttonBackgroundColor
-                    window: palette.dark // NOTE: Fusion theme uses darker window colour for the border of the checkbox
-                    base: Style.backgroundColor
-                    toolTipBase: Style.backgroundColor
-                    toolTipText: Style.ncTextColor
-                }
-
                 text: qsTr('All local versions')
 
                 leftPadding: 0
@@ -130,24 +92,6 @@ ApplicationWindow {
 
                 Layout.fillWidth: true
 
-                palette {
-                    text: Style.ncTextColor
-                    windowText: Style.ncTextColor
-                    buttonText: Style.ncTextColor
-                    brightText: Style.ncTextBrightColor
-                    highlight: Style.lightHover
-                    highlightedText: Style.ncTextColor
-                    light: Style.lightHover
-                    midlight: Style.ncSecondaryTextColor
-                    mid: Style.darkerHover
-                    dark: Style.menuBorder
-                    button: Style.buttonBackgroundColor
-                    window: palette.dark // NOTE: Fusion theme uses darker window colour for the border of the checkbox
-                    base: Style.backgroundColor
-                    toolTipBase: Style.backgroundColor
-                    toolTipText: Style.ncTextColor
-                }
-
                 text: qsTr('All server versions')
 
                 leftPadding: 0
index abcf3e850f90ec660e1191f54f5856d772f16a83..39c9590e26b31738e57777fc6b7485615988e7f4 100644 (file)
@@ -33,26 +33,6 @@ ApplicationWindow {
 
     title: qsTr("File details of %1 ยท %2").arg(fileDetailsPage.fileDetails.name).arg(Systray.windowTitle)
 
-    // 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.ncSecondaryTextColor
-        mid: Style.darkerHover
-        dark: Style.menuBorder
-        button: Style.buttonBackgroundColor
-        window: Style.backgroundColor
-        base: Style.backgroundColor
-        toolTipBase: Style.backgroundColor
-        toolTipText: Style.ncTextColor
-    }
-
     FileDetailsView {
         id: fileDetailsPage
         anchors.fill: parent
index 8b6f7930515c50babe887e84fff579389be28353..a1a8c1bdc29cad634aa8b8e70efc93ae9d5ed7c4 100644 (file)
@@ -314,30 +314,6 @@ Page {
                 active: !root.isFolderItem && !root.isEncryptedItem
                 visible: active
                 sourceComponent: CheckBox {
-                    // TODO: Rather than setting all these palette colours manually,
-                    // create a custom style and do it for all components globally.
-                    //
-                    // Additionally, we need to override the entire palette when we
-                    // set one palette property, as otherwise we default back to the
-                    // theme palette -- not the parent palette
-                    palette {
-                        text: Style.ncTextColor
-                        windowText: Style.ncTextColor
-                        buttonText: Style.ncTextColor
-                        brightText: Style.ncTextBrightColor
-                        highlight: Style.lightHover
-                        highlightedText: Style.ncTextColor
-                        light: Style.lightHover
-                        midlight: Style.ncSecondaryTextColor
-                        mid: Style.darkerHover
-                        dark: Style.menuBorder
-                        button: Style.buttonBackgroundColor
-                        window: Style.menuBorder
-                        base: Style.backgroundColor
-                        toolTipBase: Style.backgroundColor
-                        toolTipText: Style.ncTextColor
-                    }
-
                     spacing: scrollContentsColumn.indicatorSpacing
                     padding: scrollContentsColumn.itemPadding
                     indicator.width: scrollContentsColumn.indicatorItemWidth
@@ -419,30 +395,6 @@ Page {
 
                         Layout.fillWidth: true
 
-                        // TODO: Rather than setting all these palette colours manually,
-                        // create a custom style and do it for all components globally.
-                        //
-                        // Additionally, we need to override the entire palette when we
-                        // set one palette property, as otherwise we default back to the
-                        // theme palette -- not the parent palette
-                        palette {
-                            text: Style.ncTextColor
-                            windowText: Style.ncTextColor
-                            buttonText: Style.ncTextColor
-                            brightText: Style.ncTextBrightColor
-                            highlight: Style.lightHover
-                            highlightedText: Style.ncTextColor
-                            light: Style.lightHover
-                            midlight: Style.ncSecondaryTextColor
-                            mid: Style.darkerHover
-                            dark: Style.menuBorder
-                            button: Style.buttonBackgroundColor
-                            window: palette.dark // NOTE: Fusion theme uses darker window colour for the border of the checkbox
-                            base: Style.backgroundColor
-                            toolTipBase: Style.backgroundColor
-                            toolTipText: Style.ncTextColor
-                        }
-
                         spacing: scrollContentsColumn.indicatorSpacing
                         padding: scrollContentsColumn.itemPadding
                         indicator.width: scrollContentsColumn.indicatorItemWidth
@@ -482,30 +434,6 @@ Page {
                         anchors.left: parent.left
                         anchors.right: parent.right
 
-                        // TODO: Rather than setting all these palette colours manually,
-                        // create a custom style and do it for all components globally.
-                        //
-                        // Additionally, we need to override the entire palette when we
-                        // set one palette property, as otherwise we default back to the
-                        // theme palette -- not the parent palette
-                        palette {
-                            text: Style.ncTextColor
-                            windowText: Style.ncTextColor
-                            buttonText: Style.ncTextColor
-                            brightText: Style.ncTextBrightColor
-                            highlight: Style.lightHover
-                            highlightedText: Style.ncTextColor
-                            light: Style.lightHover
-                            midlight: Style.ncSecondaryTextColor
-                            mid: Style.darkerHover
-                            dark: Style.menuBorder
-                            button: Style.buttonBackgroundColor
-                            window: palette.dark // NOTE: Fusion theme uses darker window colour for the border of the checkbox
-                            base: Style.backgroundColor
-                            toolTipBase: Style.backgroundColor
-                            toolTipText: Style.ncTextColor
-                        }
-
                         spacing: scrollContentsColumn.indicatorSpacing
                         padding: scrollContentsColumn.itemPadding
                         indicator.width: scrollContentsColumn.indicatorItemWidth
@@ -531,30 +459,6 @@ Page {
 
                 Layout.fillWidth: true
 
-                // TODO: Rather than setting all these palette colours manually,
-                // create a custom style and do it for all components globally.
-                //
-                // Additionally, we need to override the entire palette when we
-                // set one palette property, as otherwise we default back to the
-                // theme palette -- not the parent palette
-                palette {
-                    text: Style.ncTextColor
-                    windowText: Style.ncTextColor
-                    buttonText: Style.ncTextColor
-                    brightText: Style.ncTextBrightColor
-                    highlight: Style.lightHover
-                    highlightedText: Style.ncTextColor
-                    light: Style.lightHover
-                    midlight: Style.ncSecondaryTextColor
-                    mid: Style.darkerHover
-                    dark: Style.menuBorder
-                    button: Style.buttonBackgroundColor
-                    window: Style.menuBorder
-                    base: Style.backgroundColor
-                    toolTipBase: Style.backgroundColor
-                    toolTipText: Style.ncTextColor
-                }
-
                 spacing: scrollContentsColumn.indicatorSpacing
                 padding: scrollContentsColumn.itemPadding
                 indicator.width: scrollContentsColumn.indicatorItemWidth
@@ -664,30 +568,6 @@ Page {
 
                 Layout.fillWidth: true
 
-                // TODO: Rather than setting all these palette colours manually,
-                // create a custom style and do it for all components globally.
-                //
-                // Additionally, we need to override the entire palette when we
-                // set one palette property, as otherwise we default back to the
-                // theme palette -- not the parent palette
-                palette {
-                    text: Style.ncTextColor
-                    windowText: Style.ncTextColor
-                    buttonText: Style.ncTextColor
-                    brightText: Style.ncTextBrightColor
-                    highlight: Style.lightHover
-                    highlightedText: Style.ncTextColor
-                    light: Style.lightHover
-                    midlight: Style.ncSecondaryTextColor
-                    mid: Style.darkerHover
-                    dark: Style.menuBorder
-                    button: Style.buttonBackgroundColor
-                    window: Style.menuBorder
-                    base: Style.backgroundColor
-                    toolTipBase: Style.backgroundColor
-                    toolTipText: Style.ncTextColor
-                }
-
                 spacing: scrollContentsColumn.indicatorSpacing
                 padding: scrollContentsColumn.itemPadding
                 indicator.width: scrollContentsColumn.indicatorItemWidth
@@ -772,30 +652,6 @@ Page {
 
                 Layout.fillWidth: true
 
-                // TODO: Rather than setting all these palette colours manually,
-                // create a custom style and do it for all components globally.
-                //
-                // Additionally, we need to override the entire palette when we
-                // set one palette property, as otherwise we default back to the
-                // theme palette -- not the parent palette
-                palette {
-                    text: Style.ncTextColor
-                    windowText: Style.ncTextColor
-                    buttonText: Style.ncTextColor
-                    brightText: Style.ncTextBrightColor
-                    highlight: Style.lightHover
-                    highlightedText: Style.ncTextColor
-                    light: Style.lightHover
-                    midlight: Style.ncSecondaryTextColor
-                    mid: Style.darkerHover
-                    dark: Style.menuBorder
-                    button: Style.buttonBackgroundColor
-                    window: Style.menuBorder
-                    base: Style.backgroundColor
-                    toolTipBase: Style.backgroundColor
-                    toolTipText: Style.ncTextColor
-                }
-
                 spacing: scrollContentsColumn.indicatorSpacing
                 padding: scrollContentsColumn.itemPadding
                 indicator.width: scrollContentsColumn.indicatorItemWidth
index a4efa0a32eae9a34c9f5da76f8a8612ef84dfeca..b68e71757f63d5bf6295ff8e7ebda5455162e384 100644 (file)
@@ -31,26 +31,6 @@ Page {
 
     title: qsTr("Virtual files settings")
 
-    // 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.ncSecondaryTextColor
-        mid: Style.darkerHover
-        dark: Style.menuBorder
-        button: Style.buttonBackgroundColor
-        window: Style.backgroundColor
-        base: Style.backgroundColor
-        toolTipBase: Style.backgroundColor
-        toolTipText: Style.ncTextColor
-    }
-
     background: Rectangle {
         color: palette.window
         border.width: root.showBorder ? Style.normalBorderWidth : 0
index 0bd53c8ba1430d73e3733f6452823492807d2b9a..7fb42de2d0393de10c2c6347ba1a568dbcc46b27 100644 (file)
@@ -55,26 +55,6 @@ ApplicationWindow {
     width: root.windowWidth
     height: rootBackground.height
 
-    // 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.ncSecondaryTextColor
-        mid: Style.darkerHover
-        dark: Style.menuBorder
-        button: Style.buttonBackgroundColor
-        window: Style.backgroundColor
-        base: Style.backgroundColor
-        toolTipBase: Style.backgroundColor
-        toolTipText: Style.ncTextColor
-    }
-
     Component.onCompleted: {
         Systray.forceWindowInit(root);
         Systray.positionNotificationWindow(root);
index 42c41322394f935de7781232f43cf90c967ba17c..6e02637d80f1b54f4124436b0d0009840955e392 100644 (file)
@@ -19,26 +19,6 @@ ApplicationWindow {
     readonly property real fontPixelSize: Style.topLinePixelSize * 1.5
     readonly property real iconWidth: fontPixelSize * 2
 
-    // 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.ncSecondaryTextColor
-        mid: Style.darkerHover
-        dark: Style.menuBorder
-        button: Style.buttonBackgroundColor
-        window: Style.backgroundColor
-        base: Style.backgroundColor
-        toolTipBase: Style.backgroundColor
-        toolTipText: Style.ncTextColor
-    }
-
     Component.onCompleted: {
         Systray.forceWindowInit(root);
         x = Screen.width / 2 - width / 2
index 2f9b8069fd586685770bef59b609c9d4b4da15fb..8625efa15bcdf82b8a95057dff3de80517e75cad 100644 (file)
@@ -167,7 +167,6 @@ AbstractButton {
                     height: visible ? implicitHeight : 0\r
                     text: qsTr("Set status")\r
                     font.pixelSize: Style.topLinePixelSize\r
-                    palette.windowText: Style.ncTextColor\r
                     hoverEnabled: true\r
                     onClicked: showUserStatusSelector(index)\r
                 }\r
@@ -175,7 +174,6 @@ AbstractButton {
                 MenuItem {\r
                     text: model.isConnected ? qsTr("Log out") : qsTr("Log in")\r
                     font.pixelSize: Style.topLinePixelSize\r
-                    palette.windowText: Style.ncTextColor\r
                     hoverEnabled: true\r
                     onClicked: {\r
                         model.isConnected ? UserModel.logout(index) : UserModel.login(index)\r
@@ -209,7 +207,6 @@ AbstractButton {
                     id: removeAccountButton\r
                     text: qsTr("Remove account")\r
                     font.pixelSize: Style.topLinePixelSize\r
-                    palette.windowText: Style.ncTextColor\r
                     hoverEnabled: true\r
                     onClicked: {\r
                         UserModel.removeAccount(index)\r
index 3106a6b95c5176fdb2e746c80076561a3af8ad9a..a652ffa6d972207f67f95e7d555655a0fd8941d0 100644 (file)
@@ -36,26 +36,6 @@ ApplicationWindow {
     height:     Style.trayWindowHeight\r
     flags:      Systray.useNormalWindow ? Qt.Window : Qt.Dialog | Qt.FramelessWindowHint\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.ncSecondaryTextColor\r
-        mid: Style.darkerHover\r
-        dark: Style.menuBorder\r
-        button: Style.buttonBackgroundColor\r
-        window: Style.backgroundColor\r
-        base: Style.backgroundColor\r
-        toolTipBase: Style.backgroundColor\r
-        toolTipText: Style.ncTextColor\r
-    }\r
-\r
     readonly property int maxMenuHeight: Style.trayWindowHeight - Style.trayWindowHeaderHeight - 2 * Style.trayWindowBorderWidth\r
 \r
     Component.onCompleted: Systray.forceWindowInit(trayWindow)\r