From a66c074e972c51a96a378f777bb3e2e583f230e8 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 26 Jul 2019 10:43:47 +0200 Subject: [PATCH] Simplify the alignment code CURA-6598 --- resources/qml/RadioCheckbar.qml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/resources/qml/RadioCheckbar.qml b/resources/qml/RadioCheckbar.qml index 6a07d49b99..a50cb4a9fe 100644 --- a/resources/qml/RadioCheckbar.qml +++ b/resources/qml/RadioCheckbar.qml @@ -25,7 +25,13 @@ Item color: inactiveColor anchors.verticalCenter: buttonBar.verticalCenter height: barSize - width: buttonBar.width + anchors + { + left: buttonBar.left + right: buttonBar.right + leftMargin: (checkboxSize - inactiveMarkerSize) / 2 + rightMargin: (checkboxSize - inactiveMarkerSize) / 2 + } } RowLayout @@ -69,8 +75,6 @@ Item { id: activeComponent sourceComponent: isEnabled? checkboxComponent : disabledComponent - // Ensure the inactive markers that are not the first / last one align with the center of the checkboxes - x: !isEnabled && index !== 0 && index + 1 !== repeater.count ? (checkboxSize - inactiveMarkerSize) / 2: 0 } } } @@ -82,12 +86,12 @@ Item Item { height: checkboxSize - width: inactiveMarkerSize + width: checkboxSize Rectangle { anchors.centerIn: parent - height: parent.width - width: parent.width + height: inactiveMarkerSize + width: inactiveMarkerSize radius: width / 2 color: inactiveColor }