mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 14:44:13 -06:00
Simplify the alignment code
CURA-6598
This commit is contained in:
parent
e47514d6dd
commit
a66c074e97
1 changed files with 10 additions and 6 deletions
|
@ -25,7 +25,13 @@ Item
|
||||||
color: inactiveColor
|
color: inactiveColor
|
||||||
anchors.verticalCenter: buttonBar.verticalCenter
|
anchors.verticalCenter: buttonBar.verticalCenter
|
||||||
height: barSize
|
height: barSize
|
||||||
width: buttonBar.width
|
anchors
|
||||||
|
{
|
||||||
|
left: buttonBar.left
|
||||||
|
right: buttonBar.right
|
||||||
|
leftMargin: (checkboxSize - inactiveMarkerSize) / 2
|
||||||
|
rightMargin: (checkboxSize - inactiveMarkerSize) / 2
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout
|
RowLayout
|
||||||
|
@ -69,8 +75,6 @@ Item
|
||||||
{
|
{
|
||||||
id: activeComponent
|
id: activeComponent
|
||||||
sourceComponent: isEnabled? checkboxComponent : disabledComponent
|
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
|
Item
|
||||||
{
|
{
|
||||||
height: checkboxSize
|
height: checkboxSize
|
||||||
width: inactiveMarkerSize
|
width: checkboxSize
|
||||||
Rectangle
|
Rectangle
|
||||||
{
|
{
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
height: parent.width
|
height: inactiveMarkerSize
|
||||||
width: parent.width
|
width: inactiveMarkerSize
|
||||||
radius: width / 2
|
radius: width / 2
|
||||||
color: inactiveColor
|
color: inactiveColor
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue