Refactor the code a bit more to better align the components in the

recommended mode.

Contributes to CURA-5941.
This commit is contained in:
Diego Prado Gesto 2018-11-28 17:29:25 +01:00
parent 85b34d6005
commit 990c653af4
9 changed files with 1134 additions and 1242 deletions

View file

@ -12,7 +12,6 @@ Button
{
id: button
property alias iconSource: buttonIcon.source
property alias iconSourceRight: buttonIconRight.source
property alias textFont: buttonText.font
property alias cornerRadius: backgroundRect.radius
property alias tooltip: tooltip.text
@ -37,8 +36,7 @@ Button
// we elide the text to the right so the text will be cut off with the three dots at the end.
property var fixedWidthMode: false
width: buttonIcon.width + buttonText.width + buttonIconRight.width
contentItem: Item
contentItem: Row
{
UM.RecolorImage
{
@ -66,20 +64,6 @@ Button
horizontalAlignment: Text.AlignHCenter
elide: Text.ElideRight
}
UM.RecolorImage
{
id: buttonIconRight
source: ""
height: Math.round(0.6 * parent.height)
width: height
sourceSize.width: width
sourceSize.height: height
color: button.hovered ? button.textHoverColor : button.textColor
visible: source != ""
anchors.verticalCenter: parent.verticalCenter
anchors.right: source != "" ? parent.right : undefined
}
}
background: Rectangle