mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-22 21:15:55 +03:00
Add contrast to the text/icon of buttons if the server defined color is light.
Signed-off-by: Camila <hello@camila.codes>
This commit is contained in:
parent
db1454b0d4
commit
fc2408cf41
4 changed files with 16 additions and 5 deletions
|
@ -17,6 +17,9 @@ MouseArea {
|
||||||
property bool isTalkReplyOptionVisible: model.messageSent !== ""
|
property bool isTalkReplyOptionVisible: model.messageSent !== ""
|
||||||
readonly property bool isCallActivity: model.objectType === "call"
|
readonly property bool isCallActivity: model.objectType === "call"
|
||||||
|
|
||||||
|
property color adjustedHeaderColor: Theme.darkMode ? Qt.lighter(UserModel.currentUser.headerColor, 2)
|
||||||
|
: Qt.darker(UserModel.currentUser.headerColor, 1.5)
|
||||||
|
|
||||||
signal fileActivityButtonClicked(string absolutePath)
|
signal fileActivityButtonClicked(string absolutePath)
|
||||||
|
|
||||||
enabled: (model.path !== "" || model.link !== "" || model.isCurrentUserFileActivity === true)
|
enabled: (model.path !== "" || model.link !== "" || model.isCurrentUserFileActivity === true)
|
||||||
|
@ -74,6 +77,8 @@ MouseArea {
|
||||||
|
|
||||||
activityData: model
|
activityData: model
|
||||||
|
|
||||||
|
adjustedHeaderColor: root.adjustedHeaderColor
|
||||||
|
|
||||||
onShareButtonClicked: Systray.openShareDialog(model.displayPath, model.absolutePath)
|
onShareButtonClicked: Systray.openShareDialog(model.displayPath, model.absolutePath)
|
||||||
onDismissButtonClicked: activityModel.slotTriggerDismiss(model.index)
|
onDismissButtonClicked: activityModel.slotTriggerDismiss(model.index)
|
||||||
}
|
}
|
||||||
|
@ -113,6 +118,8 @@ MouseArea {
|
||||||
|
|
||||||
flickable: root.flickable
|
flickable: root.flickable
|
||||||
|
|
||||||
|
adjustedHeaderColor: root.adjustedHeaderColor
|
||||||
|
|
||||||
onTriggerAction: activityModel.slotTriggerAction(model.index, actionIndex)
|
onTriggerAction: activityModel.slotTriggerAction(model.index, actionIndex)
|
||||||
onShowReplyField: root.toggleReplyOptions()
|
onShowReplyField: root.toggleReplyOptions()
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@ RowLayout {
|
||||||
property bool displayActions: false
|
property bool displayActions: false
|
||||||
|
|
||||||
property color moreActionsButtonColor: "transparent"
|
property color moreActionsButtonColor: "transparent"
|
||||||
|
property color adjustedHeaderColor: "transparent"
|
||||||
|
|
||||||
property int maxActionButtons: 0
|
property int maxActionButtons: 0
|
||||||
|
|
||||||
|
@ -43,10 +44,10 @@ RowLayout {
|
||||||
text: model.modelData.label
|
text: model.modelData.label
|
||||||
toolTipText: model.modelData.label
|
toolTipText: model.modelData.label
|
||||||
|
|
||||||
imageSource: model.modelData.imageSource ? model.modelData.imageSource + UserModel.currentUser.headerColor : ""
|
imageSource: model.modelData.imageSource ? model.modelData.imageSource + root.adjustedHeaderColor : ""
|
||||||
imageSourceHover: model.modelData.imageSourceHovered ? model.modelData.imageSourceHovered + UserModel.currentUser.headerTextColor : ""
|
imageSourceHover: model.modelData.imageSourceHovered ? model.modelData.imageSourceHovered + UserModel.currentUser.headerTextColor : ""
|
||||||
|
|
||||||
textColor: imageSource !== "" ? UserModel.currentUser.headerColor : Style.ncTextColor
|
textColor: imageSource !== "" ? root.adjustedHeaderColor : Style.ncTextColor
|
||||||
textColorHovered: imageSource !== "" ? UserModel.currentUser.headerTextColor : Style.ncTextColor
|
textColorHovered: imageSource !== "" ? UserModel.currentUser.headerTextColor : Style.ncTextColor
|
||||||
|
|
||||||
bold: primary
|
bold: primary
|
||||||
|
|
|
@ -17,6 +17,8 @@ RowLayout {
|
||||||
|
|
||||||
property bool childHovered: shareButton.hovered || dismissActionButton.hovered
|
property bool childHovered: shareButton.hovered || dismissActionButton.hovered
|
||||||
|
|
||||||
|
property color adjustedHeaderColor: "transparent"
|
||||||
|
|
||||||
signal dismissButtonClicked()
|
signal dismissButtonClicked()
|
||||||
signal shareButtonClicked()
|
signal shareButtonClicked()
|
||||||
|
|
||||||
|
@ -221,7 +223,7 @@ RowLayout {
|
||||||
|
|
||||||
visible: root.activityData.isShareable
|
visible: root.activityData.isShareable
|
||||||
|
|
||||||
imageSource: "image://svgimage-custom-color/share.svg" + "/" + UserModel.currentUser.headerColor
|
imageSource: "image://svgimage-custom-color/share.svg" + "/" + root.adjustedHeaderColor
|
||||||
imageSourceHover: "image://svgimage-custom-color/share.svg" + "/" + UserModel.currentUser.headerTextColor
|
imageSourceHover: "image://svgimage-custom-color/share.svg" + "/" + UserModel.currentUser.headerTextColor
|
||||||
|
|
||||||
toolTipText: qsTr("Open share dialog")
|
toolTipText: qsTr("Open share dialog")
|
||||||
|
|
|
@ -15,14 +15,15 @@ Button {
|
||||||
property color textColor: Style.ncTextColor
|
property color textColor: Style.ncTextColor
|
||||||
property color textColorHovered: textColor
|
property color textColorHovered: textColor
|
||||||
|
|
||||||
property color bgColor: "transparent"
|
property alias bgColor: bgRectangle.color
|
||||||
|
|
||||||
property bool bold: false
|
property bool bold: false
|
||||||
|
|
||||||
property real bgOpacity: 0.3
|
property real bgOpacity: 0.3
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
color: root.bgColor
|
id: bgRectangle
|
||||||
|
color: "transparent"
|
||||||
opacity: parent.hovered ? 1.0 : bgOpacity
|
opacity: parent.hovered ? 1.0 : bgOpacity
|
||||||
radius: width / 2
|
radius: width / 2
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue