Fix dark mode switching issues with main tray window

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2023-05-23 23:27:30 +08:00 committed by Matthieu Gallien
parent cde52f03fa
commit fef9f3b643
9 changed files with 101 additions and 8 deletions

View 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 {

View 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

View 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 {

View 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

View 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

View 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

View 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

View file

@ -257,7 +257,6 @@ ApplicationWindow {
Layout.preferredHeight: Style.trayWindowHeaderHeight
display: AbstractButton.IconOnly
flat: true
palette: Style.systemPalette
Accessible.role: Accessible.ButtonMenu
Accessible.name: qsTr("Current account")
@ -285,7 +284,26 @@ ApplicationWindow {
width: (Style.currentAccountButtonWidth - 2)
height: Math.min(implicitHeight, maxMenuHeight)
closePolicy: Menu.CloseOnPressOutsideParent | Menu.CloseOnEscape
palette: Style.palette
// 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
}
background: Rectangle {
border.color: Style.menuBorder
@ -334,7 +352,6 @@ ApplicationWindow {
id: addAccountButton
height: Style.addAccountButtonHeight
hoverEnabled: true
palette: Theme.systemPalette
background: Item {
height: parent.height
@ -386,7 +403,6 @@ ApplicationWindow {
MenuItem {
id: syncPauseButton
font.pixelSize: Style.topLinePixelSize
palette.windowText: Style.ncTextColor
hoverEnabled: true
onClicked: Systray.syncIsPaused = !Systray.syncIsPaused
@ -409,7 +425,6 @@ ApplicationWindow {
id: settingsButton
text: qsTr("Settings")
font.pixelSize: Style.topLinePixelSize
palette.windowText: Style.ncTextColor
hoverEnabled: true
onClicked: Systray.openSettings()
@ -432,7 +447,6 @@ ApplicationWindow {
id: exitButton
text: qsTr("Exit");
font.pixelSize: Style.topLinePixelSize
palette.windowText: Style.ncTextColor
hoverEnabled: true
onClicked: Systray.shutdown()
@ -655,6 +669,26 @@ ApplicationWindow {
height: implicitHeight + y > Style.trayWindowHeight ? Style.trayWindowHeight - y : implicitHeight
closePolicy: Menu.CloseOnPressOutsideParent | Menu.CloseOnEscape
// 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
}
background: Rectangle {
border.color: Style.menuBorder
color: Style.backgroundColor
@ -682,7 +716,6 @@ ApplicationWindow {
text: model.appName
font.pixelSize: Style.topLinePixelSize
palette.windowText: Style.ncTextColor
icon.source: model.appIconUrl
icon.color: Style.ncTextColor
onTriggered: UserAppsModel.openAppUrl(appUrl)

View file

@ -11,6 +11,7 @@ QtObject {
// Colors
readonly property color ncBlue: Theme.wizardHeaderBackgroundColor
readonly property color ncTextColor: Theme.systemPalette.windowText
readonly property color ncTextBrightColor: "white"
readonly property color ncSecondaryTextColor: "#808080"
readonly property color ncHeaderTextColor: "white"
readonly property color lightHover: Theme.darkMode ? Qt.lighter(backgroundColor, 2) : Qt.darker(backgroundColor, 1.05)