mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 02:58:59 +08:00
Calculate the width of the header items only once
CURA-8013
This commit is contained in:
parent
294b67f72f
commit
5a3675df95
@ -42,6 +42,7 @@ Item
|
|||||||
anchors.left: openFileButton.right
|
anchors.left: openFileButton.right
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||||
|
property int machineSelectorWidth: Math.round((width - printSetupSelectorItem.width) / 3)
|
||||||
|
|
||||||
height: parent.height
|
height: parent.height
|
||||||
// This is a trick to make sure that the borders of the two adjacent buttons' borders overlap. Otherwise
|
// This is a trick to make sure that the borders of the two adjacent buttons' borders overlap. Otherwise
|
||||||
@ -55,7 +56,7 @@ Item
|
|||||||
headerBackgroundBorder.width: UM.Theme.getSize("default_lining").width
|
headerBackgroundBorder.width: UM.Theme.getSize("default_lining").width
|
||||||
headerBackgroundBorder.color: UM.Theme.getColor("lining")
|
headerBackgroundBorder.color: UM.Theme.getColor("lining")
|
||||||
enableHeaderShadow: false
|
enableHeaderShadow: false
|
||||||
Layout.preferredWidth: Math.round((itemRow.width - printSetupSelectorItem.width - UM.Theme.getSize("default_lining").width) * 1 / 3 - UM.Theme.getSize("default_lining").width)
|
Layout.preferredWidth: parent.machineSelectorWidth
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
}
|
}
|
||||||
@ -68,7 +69,7 @@ Item
|
|||||||
headerBackgroundBorder.color: UM.Theme.getColor("lining")
|
headerBackgroundBorder.color: UM.Theme.getColor("lining")
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredWidth: Math.round((itemRow.width - printSetupSelectorItem.width - UM.Theme.getSize("default_lining").width) * 2 / 3 - UM.Theme.getSize("default_lining").width)
|
Layout.preferredWidth: parent.machineSelectorWidth * 2
|
||||||
}
|
}
|
||||||
|
|
||||||
Item
|
Item
|
||||||
|
Loading…
x
Reference in New Issue
Block a user