Skip to content

Commit

Permalink
Fix two factor auth notification: 'Approve' link is a primary action.
Browse files Browse the repository at this point in the history
Signed-off-by: Camila <[email protected]>
  • Loading branch information
Camila committed Sep 27, 2022
1 parent 1f5ce39 commit f3513aa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/gui/tray/ActivityActionButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -38,7 +40,7 @@ Item {
}

Loader {
active: root.imageSource !== ""
active: root.imageSource !== "" || primaryButton

anchors.fill: parent

Expand Down
7 changes: 4 additions & 3 deletions src/gui/tray/ActivityItemActions.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
}
Expand Down

0 comments on commit f3513aa

Please sign in to comment.