Skip to content

Commit

Permalink
Fix dark mode switching issues with main tray window
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra committed May 23, 2023
1 parent 2600776 commit 77ee5f5
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 7 deletions.
5 changes: 5 additions & 0 deletions src/gui/filedetails/ShareDetailsPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,18 @@ 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
dark: Style.menuBorder
button: Style.menuBorder
window: Style.backgroundColor
base: Style.backgroundColor
toolTipBase: Style.backgroundColor
toolTipText: Style.ncTextColor
}

background: Rectangle {
Expand Down
5 changes: 5 additions & 0 deletions src/gui/filedetails/ShareView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,18 @@ 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
dark: Style.menuBorder
button: Style.menuBorder
window: Style.backgroundColor
base: Style.backgroundColor
toolTipBase: Style.backgroundColor
toolTipText: Style.ncTextColor
}

visible: false
Expand Down
5 changes: 5 additions & 0 deletions src/gui/filedetails/ShareeSearchField.qml
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,18 @@ 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
dark: Style.menuBorder
button: Style.menuBorder
window: Style.backgroundColor
base: Style.backgroundColor
toolTipBase: Style.backgroundColor
toolTipText: Style.ncTextColor
}

contentItem: ScrollView {
Expand Down
20 changes: 20 additions & 0 deletions src/gui/tray/ActivityItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 20 additions & 0 deletions src/gui/tray/ActivityList.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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: 1
focus: false
Expand Down
5 changes: 5 additions & 0 deletions src/gui/tray/SyncStatus.qml
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,18 @@ 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
dark: Style.menuBorder
button: Style.menuBorder
window: Style.backgroundColor
base: Style.backgroundColor
toolTipBase: Style.backgroundColor
toolTipText: Style.ncTextColor
}

value: syncStatus.syncProgress
Expand Down
47 changes: 40 additions & 7 deletions src/gui/tray/Window.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -334,7 +352,6 @@ ApplicationWindow {
id: addAccountButton
height: Style.addAccountButtonHeight
hoverEnabled: true
palette: Theme.systemPalette

background: Item {
height: parent.height
Expand Down Expand Up @@ -386,7 +403,6 @@ ApplicationWindow {
MenuItem {
id: syncPauseButton
font.pixelSize: Style.topLinePixelSize
palette.windowText: Style.ncTextColor
hoverEnabled: true
onClicked: Systray.syncIsPaused = !Systray.syncIsPaused

Expand All @@ -409,7 +425,6 @@ ApplicationWindow {
id: settingsButton
text: qsTr("Settings")
font.pixelSize: Style.topLinePixelSize
palette.windowText: Style.ncTextColor
hoverEnabled: true
onClicked: Systray.openSettings()

Expand All @@ -432,7 +447,6 @@ ApplicationWindow {
id: exitButton
text: qsTr("Exit");
font.pixelSize: Style.topLinePixelSize
palette.windowText: Style.ncTextColor
hoverEnabled: true
onClicked: Systray.shutdown()

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 77ee5f5

Please sign in to comment.