Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCamila <hello@camila.codes>2022-06-14 22:24:21 +0300
committerCamila <hello@camila.codes>2022-06-21 12:49:30 +0300
commitfc2408cf415bb496bd7f286744e2e8ae8531a5bd (patch)
treecf0ef35427565ee23d030106b601458f2609f775 /src/gui/tray
parentdb1454b0d4761e00ed38e64c4ba83049246720cc (diff)
Add contrast to the text/icon of buttons if the server defined color is light.
Signed-off-by: Camila <hello@camila.codes>
Diffstat (limited to 'src/gui/tray')
-rw-r--r--src/gui/tray/ActivityItem.qml7
-rw-r--r--src/gui/tray/ActivityItemActions.qml5
-rw-r--r--src/gui/tray/ActivityItemContent.qml4
-rw-r--r--src/gui/tray/CustomButton.qml5
4 files changed, 16 insertions, 5 deletions
diff --git a/src/gui/tray/ActivityItem.qml b/src/gui/tray/ActivityItem.qml
index a22f13964..68a153510 100644
--- a/src/gui/tray/ActivityItem.qml
+++ b/src/gui/tray/ActivityItem.qml
@@ -17,6 +17,9 @@ MouseArea {
property bool isTalkReplyOptionVisible: model.messageSent !== ""
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)
enabled: (model.path !== "" || model.link !== "" || model.isCurrentUserFileActivity === true)
@@ -74,6 +77,8 @@ MouseArea {
activityData: model
+ adjustedHeaderColor: root.adjustedHeaderColor
+
onShareButtonClicked: Systray.openShareDialog(model.displayPath, model.absolutePath)
onDismissButtonClicked: activityModel.slotTriggerDismiss(model.index)
}
@@ -113,6 +118,8 @@ MouseArea {
flickable: root.flickable
+ adjustedHeaderColor: root.adjustedHeaderColor
+
onTriggerAction: activityModel.slotTriggerAction(model.index, actionIndex)
onShowReplyField: root.toggleReplyOptions()
}
diff --git a/src/gui/tray/ActivityItemActions.qml b/src/gui/tray/ActivityItemActions.qml
index f86ad70d7..4e1c7121a 100644
--- a/src/gui/tray/ActivityItemActions.qml
+++ b/src/gui/tray/ActivityItemActions.qml
@@ -16,6 +16,7 @@ RowLayout {
property bool displayActions: false
property color moreActionsButtonColor: "transparent"
+ property color adjustedHeaderColor: "transparent"
property int maxActionButtons: 0
@@ -43,10 +44,10 @@ RowLayout {
text: 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 : ""
- textColor: imageSource !== "" ? UserModel.currentUser.headerColor : Style.ncTextColor
+ textColor: imageSource !== "" ? root.adjustedHeaderColor : Style.ncTextColor
textColorHovered: imageSource !== "" ? UserModel.currentUser.headerTextColor : Style.ncTextColor
bold: primary
diff --git a/src/gui/tray/ActivityItemContent.qml b/src/gui/tray/ActivityItemContent.qml
index 77d07814e..3e34acf97 100644
--- a/src/gui/tray/ActivityItemContent.qml
+++ b/src/gui/tray/ActivityItemContent.qml
@@ -17,6 +17,8 @@ RowLayout {
property bool childHovered: shareButton.hovered || dismissActionButton.hovered
+ property color adjustedHeaderColor: "transparent"
+
signal dismissButtonClicked()
signal shareButtonClicked()
@@ -221,7 +223,7 @@ RowLayout {
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
toolTipText: qsTr("Open share dialog")
diff --git a/src/gui/tray/CustomButton.qml b/src/gui/tray/CustomButton.qml
index 0ddb40d24..32d6ff575 100644
--- a/src/gui/tray/CustomButton.qml
+++ b/src/gui/tray/CustomButton.qml
@@ -15,14 +15,15 @@ Button {
property color textColor: Style.ncTextColor
property color textColorHovered: textColor
- property color bgColor: "transparent"
+ property alias bgColor: bgRectangle.color
property bool bold: false
property real bgOpacity: 0.3
background: Rectangle {
- color: root.bgColor
+ id: bgRectangle
+ color: "transparent"
opacity: parent.hovered ? 1.0 : bgOpacity
radius: width / 2
}