Add the RoundedRectangle as background to the ExpandableComponent

This way the expandable components can have rounded corners only on one side,
thus preventing the need to do add backgrounds to the rows that they are in.

CURA-5785
This commit is contained in:
Jaime van Kessel 2018-11-21 11:37:58 +01:00
parent e25a61d4d6
commit b826a42026
5 changed files with 181 additions and 158 deletions

View file

@ -24,77 +24,66 @@ Item
Item
{
anchors.horizontalCenter: parent.horizontalCenter
width: openFileButtonBackground.width + itemRowBackground.width
width: openFileButtonBackground.width + itemRow.width + UM.Theme.getSize("default_margin").width
height: parent.height
Rectangle
RowLayout
{
id: itemRowBackground
radius: UM.Theme.getSize("default_radius").width
color: UM.Theme.getColor("toolbar_background")
width: itemRow.width + UM.Theme.getSize("default_margin").width
height: parent.height
id: itemRow
anchors.left: openFileButtonBackground.right
anchors.leftMargin: UM.Theme.getSize("default_margin").width
RowLayout
width: 0.9 * prepareMenu.width
height: parent.height
spacing: 0
Cura.MachineSelector
{
id: itemRow
id: machineSelection
z: openFileButtonBackground.z - 1 //Ensure that the tooltip of the open file button stays above the item row.
headerCornerSide: 2 // Show corners on the left.
Layout.minimumWidth: UM.Theme.getSize("machine_selector_widget").width
Layout.maximumWidth: UM.Theme.getSize("machine_selector_widget").width
Layout.fillWidth: true
Layout.fillHeight: true
}
anchors.centerIn: parent
width: 0.9 * prepareMenu.width
// Separator line
Rectangle
{
height: parent.height
spacing: 0
width: UM.Theme.getSize("default_lining").width
color: UM.Theme.getColor("lining")
}
Cura.MachineSelector
{
id: machineSelection
z: openFileButtonBackground.z - 1 //Ensure that the tooltip of the open file button stays above the item row.
Layout.minimumWidth: UM.Theme.getSize("machine_selector_widget").width
Layout.maximumWidth: UM.Theme.getSize("machine_selector_widget").width
Layout.fillWidth: true
Layout.fillHeight: true
}
Cura.QuickConfigurationSelector
{
Layout.fillHeight: true
Layout.fillWidth: true
Layout.preferredWidth: itemRow.width - machineSelection.width - printSetupSelectorItem.width - 2 * UM.Theme.getSize("default_lining").width
}
// Separator line
Rectangle
{
height: parent.height
width: UM.Theme.getSize("default_lining").width
color: UM.Theme.getColor("lining")
}
// Separator line
Rectangle
{
height: parent.height
width: UM.Theme.getSize("default_lining").width
color: UM.Theme.getColor("lining")
}
Cura.QuickConfigurationSelector
{
Layout.fillHeight: true
Layout.fillWidth: true
Layout.preferredWidth: itemRow.width - machineSelection.width - printSetupSelectorItem.width - 2 * UM.Theme.getSize("default_lining").width
}
// Separator line
Rectangle
{
height: parent.height
width: UM.Theme.getSize("default_lining").width
color: UM.Theme.getColor("lining")
}
Item
{
id: printSetupSelectorItem
// This is a work around to prevent the printSetupSelector from having to be re-loaded every time
// a stage switch is done.
children: [printSetupSelector]
height: childrenRect.height
width: childrenRect.width
}
Item
{
id: printSetupSelectorItem
// This is a work around to prevent the printSetupSelector from having to be re-loaded every time
// a stage switch is done.
children: [printSetupSelector]
height: childrenRect.height
width: childrenRect.width
}
}
Rectangle
{
id: openFileButtonBackground