Skip to content

Commit

Permalink
Merge pull request #5741 from nextcloud/backport/5715/stable-3.9
Browse files Browse the repository at this point in the history
[stable-3.9] Fix tray styling
  • Loading branch information
mgallien authored May 30, 2023
2 parents 32c1b9d + 15c9cbf commit c389ced
Show file tree
Hide file tree
Showing 52 changed files with 365 additions and 365 deletions.
15 changes: 5 additions & 10 deletions src/gui/BasicComboBox.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ComboBox {

background: Rectangle {
radius: Style.slightlyRoundedButtonRadius
color: Style.buttonBackgroundColor
color: palette.button
opacity: clearComboBox.hovered ? Style.hoverOpacity : 1.0
}

Expand All @@ -39,7 +39,6 @@ ComboBox {
rightPadding: clearComboBox.indicator.width + clearComboBox.spacing

text: clearComboBox.displayText
color: Style.ncTextColor
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
}
Expand All @@ -50,13 +49,13 @@ ComboBox {
anchors.verticalCenter: clearComboBox.verticalCenter

cached: true
color: Style.ncTextColor
width: source.width
height: source.height

source: Image {
horizontalAlignment: Qt.AlignRight
verticalAlignment: Qt.AlignVCenter
source: "qrc:///client/theme/white/caret-down.svg"
source: "image://svgimage-custom-color/caret-down.svg/" + palette.windowText
sourceSize.width: Style.accountDropDownCaretSize
sourceSize.height: Style.accountDropDownCaretSize
Accessible.role: Accessible.PopupMenu
Expand All @@ -80,8 +79,8 @@ ComboBox {
}

background: Rectangle {
color: Style.backgroundColor
border.color: Style.menuBorder
color: palette.toolTipBase
border.color: palette.dark
radius: Style.slightlyRoundedButtonRadius
}
}
Expand All @@ -92,13 +91,9 @@ ComboBox {
width: clearComboBox.width
contentItem: EnforcedPlainTextLabel {
text: modelData.display
color: Style.ncTextColor
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
}
highlighted: clearComboBox.highlightedIndex === index
background: Rectangle {
color: clearStatusDelegate.highlighted || clearStatusDelegate.hovered ? Style.lightHover : Style.backgroundColor
}
}
}
18 changes: 10 additions & 8 deletions src/gui/EmojiPicker.qml
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,19 @@ ColumnLayout {
height: headerLayout.height

background: Rectangle {
color: Style.lightHover
visible: ListView.isCurrentItem || headerDelegate.highlighted || headerDelegate.checked || headerDelegate.down || headerDelegate.hovered
color: palette.highlight
visible: ListView.isCurrentItem ||
headerDelegate.highlighted ||
headerDelegate.checked ||
headerDelegate.down ||
headerDelegate.hovered
radius: Style.slightlyRoundedButtonRadius
}

contentItem: EnforcedPlainTextLabel {
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: emoji
color: Style.ncTextColor
}

Rectangle {
Expand All @@ -70,7 +73,7 @@ ColumnLayout {

visible: ListView.isCurrentItem

color: Style.menuBorder
color: palette.dark
}


Expand All @@ -84,7 +87,7 @@ ColumnLayout {
Rectangle {
height: Style.normalBorderWidth
Layout.fillWidth: true
color: Style.menuBorder
color: palette.dark
}

GridView {
Expand All @@ -109,7 +112,7 @@ ColumnLayout {
height: metrics.height * 2

background: Rectangle {
color: Style.lightHover
color: palette.highlight
visible: ListView.isCurrentItem || emojiDelegate.highlighted || emojiDelegate.checked || emojiDelegate.down || emojiDelegate.hovered
radius: Style.slightlyRoundedButtonRadius
}
Expand All @@ -118,7 +121,6 @@ ColumnLayout {
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: modelData === undefined ? "" : modelData.unicode
color: Style.ncTextColor
}

onClicked: {
Expand All @@ -132,7 +134,7 @@ ColumnLayout {
width: parent.width * 0.8
anchors.centerIn: parent
text: qsTr("No recent emojis")
color: Style.ncSecondaryTextColor
color: palette.midlight
wrapMode: Text.Wrap
font.bold: true
visible: emojiView.count === 0
Expand Down
4 changes: 1 addition & 3 deletions src/gui/ErrorBox.qml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ Item {

EnforcedPlainTextLabel {
Layout.fillWidth: true
color: Style.ncTextColor
font.bold: true
text: qsTr("Error")
visible: errorBox.showCloseButton
Expand All @@ -70,7 +69,7 @@ Item {
Layout.preferredHeight: Style.iconButtonWidth

background: null
icon.color: Style.ncTextColor
icon.color: palette.buttonText
icon.source: "qrc:///client/theme/close.svg"

visible: errorBox.showCloseButton
Expand All @@ -86,7 +85,6 @@ Item {
Layout.fillHeight: true
Layout.columnSpan: 2

color: Style.ncTextColor
wrapMode: Text.WordWrap
text: errorBox.text
}
Expand Down
5 changes: 1 addition & 4 deletions src/gui/PredefinedStatusButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ AbstractButton {
property string clearAtText: ""

background: Rectangle {
color: root.hovered || root.checked ? Style.lightHover : "transparent"
color: root.hovered || root.checked ? palette.highlight : "transparent"
radius: Style.slightlyRoundedButtonRadius
}

Expand All @@ -53,20 +53,17 @@ AbstractButton {
spacing: Style.smallSpacing
EnforcedPlainTextLabel {
text: root.statusText
color: Style.ncTextColor
verticalAlignment: Text.AlignVCenter
font.bold: true
}

EnforcedPlainTextLabel {
text: "-"
color: Style.ncTextColor
verticalAlignment: Text.AlignVCenter
}

EnforcedPlainTextLabel {
text: root.clearAtText
color: Style.ncTextColor
verticalAlignment: Text.AlignVCenter
}
}
Expand Down
26 changes: 23 additions & 3 deletions src/gui/ResolveConflictsDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import Style 1.0
import com.nextcloud.desktopclient 1.0
import "./tray"

QtWindow.Window {
ApplicationWindow {
id: conflictsDialog

required property var allConflicts
Expand All @@ -36,6 +36,26 @@ QtWindow.Window {
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
Expand Down Expand Up @@ -110,7 +130,7 @@ QtWindow.Window {
Layout.fillWidth: true
Layout.leftMargin: 5
Layout.rightMargin: 5
color: Style.menuBorder
color: palette.dark
height: 1
}

Expand Down Expand Up @@ -167,7 +187,7 @@ QtWindow.Window {
}

Rectangle {
color: Theme.systemPalette.window
color: Style.backgroundColor
anchors.fill: parent
z: 1
}
Expand Down
26 changes: 11 additions & 15 deletions src/gui/UserStatusSelector.qml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ ColumnLayout {
horizontalAlignment: Text.AlignHCenter
font.bold: true
text: qsTr("Online status")
color: Style.ncTextColor
}

GridLayout {
Expand Down Expand Up @@ -123,7 +122,6 @@ ColumnLayout {
horizontalAlignment: Text.AlignHCenter
font.bold: true
text: qsTr("Status message")
color: Style.ncTextColor
}

RowLayout {
Expand All @@ -146,13 +144,13 @@ ColumnLayout {
padding: 0
z: hovered ? 2 : 0 // Make sure highlight is seen on top of text field

property color borderColor: showBorder ? Style.ncBlue : Style.menuBorder
property color borderColor: showBorder ? Style.ncBlue : palette.dark

// We create the square with only the top-left and bottom-left rounded corners
// by overlaying different rectangles on top of each other
background: Rectangle {
radius: Style.slightlyRoundedButtonRadius
color: Style.buttonBackgroundColor
color: palette.button
border.color: fieldButton.borderColor
border.width: Style.normalBorderWidth

Expand All @@ -161,7 +159,7 @@ ColumnLayout {
anchors.leftMargin: parent.width / 2
anchors.rightMargin: -1
z: 1
color: Style.buttonBackgroundColor
color: palette.button
border.color: fieldButton.borderColor
border.width: Style.normalBorderWidth
}
Expand All @@ -173,7 +171,7 @@ ColumnLayout {
anchors.topMargin: Style.normalBorderWidth
anchors.bottomMargin: Style.normalBorderWidth
z: 2
color: Style.buttonBackgroundColor
color: palette.button
}
}
}
Expand All @@ -187,9 +185,9 @@ ColumnLayout {
anchors.centerIn: Overlay.overlay

background: Rectangle {
color: Style.backgroundColor
color: palette.toolTipBase
border.width: Style.normalBorderWidth
border.color: Style.menuBorder
border.color: palette.dark
radius: Style.slightlyRoundedButtonRadius
}

Expand All @@ -206,30 +204,29 @@ ColumnLayout {
TextField {
id: userStatusMessageTextField

property color borderColor: activeFocus ? Style.ncBlue : Style.menuBorder
property color borderColor: activeFocus ? Style.ncBlue : palette.dark

Layout.fillWidth: true
Layout.preferredHeight: contentHeight + (Style.smallSpacing * 2)

placeholderText: qsTr("What is your status?")
placeholderTextColor: Style.ncSecondaryTextColor
placeholderTextColor: palette.midlight
text: userStatusSelectorModel.userStatusMessage
color: Style.ncTextColor
verticalAlignment: TextInput.AlignVCenter
selectByMouse: true
onEditingFinished: userStatusSelectorModel.userStatusMessage = text

background: Rectangle {
radius: Style.slightlyRoundedButtonRadius
color: Style.backgroundColor
color: palette.base
border.color: userStatusMessageTextField.borderColor
border.width: Style.normalBorderWidth

Rectangle {
anchors.fill: parent
anchors.rightMargin: parent.width / 2
z: 1
color: Style.backgroundColor
color: palette.base
border.color: userStatusMessageTextField.borderColor
border.width: Style.normalBorderWidth
}
Expand All @@ -241,7 +238,7 @@ ColumnLayout {
anchors.topMargin: Style.normalBorderWidth
anchors.bottomMargin: Style.normalBorderWidth
z: 2
color: Style.backgroundColor
color: palette.base
}
}
}
Expand Down Expand Up @@ -285,7 +282,6 @@ ColumnLayout {
verticalAlignment: Text.AlignVCenter

text: qsTr("Clear status message after")
color: Style.ncTextColor
wrapMode: Text.Wrap
}

Expand Down
6 changes: 3 additions & 3 deletions src/gui/UserStatusSelectorButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ AbstractButton {

background: Rectangle {
radius: root.primary ? Style.veryRoundedButtonRadius : Style.mediumRoundedButtonRadius
color: root.colored ? Style.ncBlue : Style.buttonBackgroundColor
color: root.colored ? Style.ncBlue : palette.button
opacity: root.colored && root.hovered ? Style.hoverOpacity : 1.0
border.color: Style.ncBlue
border.width: root.showBorder ? root.primary ? Style.normalBorderWidth : Style.thickBorderWidth : 0
Expand Down Expand Up @@ -71,7 +71,7 @@ AbstractButton {

text: root.text
wrapMode: Text.Wrap
color: root.colored ? Style.ncHeaderTextColor : Style.ncTextColor
color: root.colored ? palette.brightText : palette.buttonText
font.bold: root.primary
}

Expand All @@ -85,7 +85,7 @@ AbstractButton {

text: root.secondaryText
wrapMode: Text.Wrap
color: Style.ncSecondaryTextColor
color: palette.midlight
visible: root.secondaryText !== ""
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/UserStatusSelectorPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Page {
padding: Style.standardSpacing * 2

background: Rectangle {
color: Style.backgroundColor
color: palette.window
radius: Style.trayWindowRadius
}

Expand Down
Loading

0 comments on commit c389ced

Please sign in to comment.