From f4f48c0fdab65a5e520a8cf64bf677d32fbdc164 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 9 Jul 2021 14:23:14 +0200 Subject: 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. --- plugins/PrepareStage/PrepareMenu.qml | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) (limited to 'plugins/PrepareStage/PrepareMenu.qml') diff --git a/plugins/PrepareStage/PrepareMenu.qml b/plugins/PrepareStage/PrepareMenu.qml index bf6b76360f..850d329ab2 100644 --- a/plugins/PrepareStage/PrepareMenu.qml +++ b/plugins/PrepareStage/PrepareMenu.qml @@ -78,35 +78,28 @@ 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 + UM.RecolorImage { - id: openFileIconContainer - height: parent.height - width: height //Square button. + id: buttonIcon + 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") - 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 - color: UM.Theme.getColor("icon") - - sourceSize.height: height - } + sourceSize.height: height } Item { -- cgit v1.2.3