Fix two factor auth notification: 'Approve' link is a primary action.
authorCamila <hello@camila.codes>
Tue, 20 Sep 2022 18:50:12 +0000 (20:50 +0200)
committerCamila (Rebase PR Action) <hello@camila.codes>
Tue, 27 Sep 2022 14:49:29 +0000 (14:49 +0000)
Signed-off-by: Camila <hello@camila.codes>
src/gui/tray/ActivityActionButton.qml
src/gui/tray/ActivityItemActions.qml

index eca55ebdcbd0ce516dd53686f2a1480adf7c1e4c..53ae3f40a750b207e5e38602a226b23c8e0a797f 100644 (file)
@@ -18,10 +18,12 @@ Item {
     property color textColor: Style.ncTextColor
     property color textColorHovered: Style.ncSecondaryTextColor
 
+    property bool primaryButton: false
+
     signal clicked()
 
     Loader {
-        active: root.imageSource === ""
+        active: root.imageSource === "" && !primaryButton
 
         anchors.fill: parent
 
@@ -38,7 +40,7 @@ Item {
     }
 
     Loader {
-        active: root.imageSource !== ""
+        active: root.imageSource !== "" || primaryButton
 
         anchors.fill: parent
 
index 6d9da418224079b4d3de5cc54fe146dd3e6434ea..40934fea6098a3e3868302ec550600ddef968e09 100644 (file)
@@ -34,7 +34,7 @@ RowLayout {
             id: activityActionButton
 
             readonly property string verb: model.modelData.verb
-            readonly property bool primary: model.index === 0 && verb !== "DELETE"
+            readonly property bool primary: (model.index === 0 && verb !== "DELETE") || model.modelData.primary
             readonly property bool isTalkReplyButton: verb === "REPLY"
 
             Layout.minimumWidth: primary ? Style.activityItemActionPrimaryButtonMinWidth : Style.activityItemActionSecondaryButtonMinWidth
@@ -46,10 +46,11 @@ RowLayout {
             imageSource: model.modelData.imageSource ? model.modelData.imageSource + root.adjustedHeaderColor : ""
             imageSourceHover: model.modelData.imageSourceHovered ? model.modelData.imageSourceHovered + UserModel.currentUser.headerTextColor : ""
 
-            textColor: imageSource !== "" ? root.adjustedHeaderColor : Style.ncTextColor
-            textColorHovered: imageSource !== "" ? UserModel.currentUser.headerTextColor : Style.ncTextColor
+            textColor: imageSource !== "" || primary ? root.adjustedHeaderColor : Style.ncTextColor
+            textColorHovered: imageSource !== "" || primary ? UserModel.currentUser.headerTextColor : Style.ncTextColor
 
             bold: primary
+            primaryButton: primary
 
             onClicked: !isTalkReplyButton ? root.triggerAction(model.index) : root.showReplyField()
         }