Improve share view tab buttons

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2022-09-15 18:25:41 +02:00
parent eda0328e9c
commit d92bc91bdf
No known key found for this signature in database
GPG key ID: C839200C384636B0

View file

@ -25,15 +25,16 @@ TabButton {
property string svgCustomColorSource: ""
padding: 0
padding: Style.smallSpacing
background: Rectangle {
radius: Style.slightlyRoundedButtonRadius
color: tabButton.pressed ? Style.lightHover : Style.backgroundColor
}
contentItem: ColumnLayout {
id: tabButtonLayout
property var elementColors: tabButton.checked ? Style.ncTextColor : Style.ncSecondaryTextColor
property var elementColors: tabButton.checked || tabButton.hovered ? Style.ncTextColor : Style.ncSecondaryTextColor
// We'd like to just set the height of the Image, but this causes crashing.
// So we use a wrapping Item and use anchors to adjust the size.
@ -76,9 +77,11 @@ TabButton {
property int textWidth: fontMetrics.boundingRect(tabButtonLabel.text).width
Layout.fillWidth: true
implicitWidth: textWidth + Style.standardSpacing * 2
implicitHeight: 2
color: tabButton.checked ? Style.ncBlue : "transparent"
color: tabButton.checked ? Style.ncBlue : tabButton.hovered ? Style.lightHover : "transparent"
}
}
}