mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
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:
parent
41642a35ff
commit
f4f48c0fda
1 changed files with 10 additions and 17 deletions
|
@ -78,35 +78,28 @@ Item
|
||||||
{
|
{
|
||||||
id: openFileButton
|
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
|
leftPadding: topPadding
|
||||||
rightPadding: topPadding
|
rightPadding: topPadding
|
||||||
bottomPadding: topPadding
|
bottomPadding: topPadding
|
||||||
|
|
||||||
height: UM.Theme.getSize("stage_menu").height
|
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()
|
onClicked: Cura.Actions.open.trigger()
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
|
|
||||||
contentItem: Row
|
contentItem: Row
|
||||||
{
|
{
|
||||||
Item
|
UM.RecolorImage
|
||||||
{
|
{
|
||||||
id: openFileIconContainer
|
id: buttonIcon
|
||||||
height: parent.height
|
source: UM.Theme.getIcon("Folder", "medium")
|
||||||
width: height //Square button.
|
width: UM.Theme.getSize("button_icon").width
|
||||||
|
height: UM.Theme.getSize("button_icon").height
|
||||||
|
color: UM.Theme.getColor("icon")
|
||||||
|
|
||||||
UM.RecolorImage
|
sourceSize.height: height
|
||||||
{
|
|
||||||
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
|
|
||||||
color: UM.Theme.getColor("icon")
|
|
||||||
|
|
||||||
sourceSize.height: height
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Item
|
Item
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue