uiux(StatusTimeline): fix send button look & feel
Due to how `StatusButton` has evolved, the send button in the Status timeline no longer looked and behaved the way it was supposed to. This commit patches that by introducing new properties to `StatusButton` and making use of them in the Status timline, so that existing buttons don't break. It also fixes a bug in the StatusButton where the hovered background color was wrongly calculated.
This commit is contained in:
parent
59b1a70f7e
commit
ea2238f998
|
@ -12,7 +12,9 @@ Button {
|
|||
property color color: type === "warn" ? Style.current.danger : Style.current.buttonForegroundColor
|
||||
property color bgColor: type === "warn" ? Style.current.buttonWarnBackgroundColor : Style.current.buttonBackgroundColor
|
||||
property color borderColor: color
|
||||
property color hoveredBorderColor
|
||||
property color hoveredBorderColor: color
|
||||
property bool forceBgColorOnHover: false
|
||||
property int borderRadius: Style.current.radius
|
||||
property color bgHoverColor: {
|
||||
if (type === "warn") {
|
||||
if (showBorder) {
|
||||
|
@ -111,21 +113,21 @@ Button {
|
|||
}
|
||||
|
||||
background: Rectangle {
|
||||
radius: Style.current.radius
|
||||
radius: borderRadius
|
||||
anchors.fill: parent
|
||||
border.width: flat || showBorder ? 1 : 0
|
||||
border.color: {
|
||||
if (hovered) {
|
||||
return !!control.hoveredBorderColor ? control.hoveredBorderColor : control.borderColor
|
||||
return control.hoveredBorderColor !== control.borderColor ? control.hoveredBorderColor : control.borderColor
|
||||
}
|
||||
if (showBorder) {
|
||||
if (showBorder && enabled) {
|
||||
return control.borderColor
|
||||
}
|
||||
return Style.current.transparent
|
||||
}
|
||||
color: {
|
||||
if (flat) {
|
||||
return "transparent"
|
||||
return hovered && forceBgColorOnHover ? control.bgHoverColor : "transparent"
|
||||
}
|
||||
if (type === "secondary") {
|
||||
return hovered ? control.bgColor : "transparent"
|
||||
|
|
|
@ -753,11 +753,14 @@ Rectangle {
|
|||
StatusButton {
|
||||
id: sendBtn
|
||||
icon.source: "../../app/img/send.svg"
|
||||
color: Style.current.secondaryText
|
||||
icon.width: 16
|
||||
icon.height: 18
|
||||
borderRadius: 16
|
||||
text: qsTr("Send")
|
||||
type: "secondary"
|
||||
flat: true
|
||||
showBorder: true
|
||||
forceBgColorOnHover: true
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: Style.current.halfPadding
|
||||
anchors.bottom: parent.bottom
|
||||
|
|
Loading…
Reference in New Issue