Move padding to only be around row

Not around the individual icons. This way the chevron can be placed next to the icon closer.

Contributes to issue CURA-8008.
This commit is contained in:
Ghostkeeper 2021-07-09 14:23:14 +02:00
parent 41642a35ff
commit f4f48c0fda
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A

View file

@ -78,28 +78,22 @@ Item
{
id: openFileButton
//Make the button square if the contents are.
//Make the padding such that the main icon is centred, even if something else is placed besides it.
topPadding: Math.round((parent.height - buttonIcon.height) / 2)
leftPadding: topPadding
rightPadding: topPadding
bottomPadding: topPadding
height: UM.Theme.getSize("stage_menu").height
width: leftPadding + openFileIconContainer.width + openFileChevronContainer.width + rightPadding
width: leftPadding + buttonIcon.width + openFileChevronContainer.width + rightPadding
onClicked: Cura.Actions.open.trigger()
hoverEnabled: true
contentItem: Row
{
Item
{
id: openFileIconContainer
height: parent.height
width: height //Square button.
UM.RecolorImage
{
id: buttonIcon
anchors.centerIn: parent
source: UM.Theme.getIcon("Folder", "medium")
width: UM.Theme.getSize("button_icon").width
height: UM.Theme.getSize("button_icon").height
@ -107,7 +101,6 @@ Item
sourceSize.height: height
}
}
Item
{
id: openFileChevronContainer