From 65dd912dd6306b5d48f6ee4de6bc5a4f4b9f00a0 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Wed, 7 Aug 2024 21:30:39 +0200 Subject: [PATCH] remove any use of custom palette: use the style palette should get us native colors as much as possible Signed-off-by: Matthieu Gallien --- src/gui/ConflictItemFileInfo.qml | 18 --- src/gui/ResolveConflictsDialog.qml | 56 ------- src/gui/filedetails/FileDetailsWindow.qml | 20 --- src/gui/filedetails/ShareDetailsPage.qml | 144 ------------------ src/gui/macOS/ui/FileProviderSettings.qml | 20 --- src/gui/tray/CallNotificationDialog.qml | 20 --- src/gui/tray/EditFileLocallyLoadingDialog.qml | 20 --- src/gui/tray/UserLine.qml | 3 - src/gui/tray/Window.qml | 20 --- 9 files changed, 321 deletions(-) diff --git a/src/gui/ConflictItemFileInfo.qml b/src/gui/ConflictItemFileInfo.qml index 7a706f7b7..be345f7e8 100644 --- a/src/gui/ConflictItemFileInfo.qml +++ b/src/gui/ConflictItemFileInfo.qml @@ -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 diff --git a/src/gui/ResolveConflictsDialog.qml b/src/gui/ResolveConflictsDialog.qml index 285bd8c03..485d874eb 100644 --- a/src/gui/ResolveConflictsDialog.qml +++ b/src/gui/ResolveConflictsDialog.qml @@ -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 diff --git a/src/gui/filedetails/FileDetailsWindow.qml b/src/gui/filedetails/FileDetailsWindow.qml index abcf3e850..39c9590e2 100644 --- a/src/gui/filedetails/FileDetailsWindow.qml +++ b/src/gui/filedetails/FileDetailsWindow.qml @@ -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 diff --git a/src/gui/filedetails/ShareDetailsPage.qml b/src/gui/filedetails/ShareDetailsPage.qml index 8b6f79305..a1a8c1bdc 100644 --- a/src/gui/filedetails/ShareDetailsPage.qml +++ b/src/gui/filedetails/ShareDetailsPage.qml @@ -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 diff --git a/src/gui/macOS/ui/FileProviderSettings.qml b/src/gui/macOS/ui/FileProviderSettings.qml index a4efa0a32..b68e71757 100644 --- a/src/gui/macOS/ui/FileProviderSettings.qml +++ b/src/gui/macOS/ui/FileProviderSettings.qml @@ -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 diff --git a/src/gui/tray/CallNotificationDialog.qml b/src/gui/tray/CallNotificationDialog.qml index 0bd53c8ba..7fb42de2d 100644 --- a/src/gui/tray/CallNotificationDialog.qml +++ b/src/gui/tray/CallNotificationDialog.qml @@ -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); diff --git a/src/gui/tray/EditFileLocallyLoadingDialog.qml b/src/gui/tray/EditFileLocallyLoadingDialog.qml index 42c413223..6e02637d8 100644 --- a/src/gui/tray/EditFileLocallyLoadingDialog.qml +++ b/src/gui/tray/EditFileLocallyLoadingDialog.qml @@ -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 diff --git a/src/gui/tray/UserLine.qml b/src/gui/tray/UserLine.qml index 2f9b8069f..8625efa15 100644 --- a/src/gui/tray/UserLine.qml +++ b/src/gui/tray/UserLine.qml @@ -167,7 +167,6 @@ AbstractButton { height: visible ? implicitHeight : 0 text: qsTr("Set status") font.pixelSize: Style.topLinePixelSize - palette.windowText: Style.ncTextColor hoverEnabled: true onClicked: showUserStatusSelector(index) } @@ -175,7 +174,6 @@ AbstractButton { MenuItem { text: model.isConnected ? qsTr("Log out") : qsTr("Log in") font.pixelSize: Style.topLinePixelSize - palette.windowText: Style.ncTextColor hoverEnabled: true onClicked: { model.isConnected ? UserModel.logout(index) : UserModel.login(index) @@ -209,7 +207,6 @@ AbstractButton { id: removeAccountButton text: qsTr("Remove account") font.pixelSize: Style.topLinePixelSize - palette.windowText: Style.ncTextColor hoverEnabled: true onClicked: { UserModel.removeAccount(index) diff --git a/src/gui/tray/Window.qml b/src/gui/tray/Window.qml index 3106a6b95..a652ffa6d 100644 --- a/src/gui/tray/Window.qml +++ b/src/gui/tray/Window.qml @@ -36,26 +36,6 @@ ApplicationWindow { height: Style.trayWindowHeight flags: Systray.useNormalWindow ? Qt.Window : Qt.Dialog | Qt.FramelessWindowHint - // 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 - } - readonly property int maxMenuHeight: Style.trayWindowHeight - Style.trayWindowHeaderHeight - 2 * Style.trayWindowBorderWidth Component.onCompleted: Systray.forceWindowInit(trayWindow)