mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-15 11:45:56 +08:00
Easier layout shifting when icons are invisible
The Row element automatically hides them and removes any spacing if they are invisible. Contributes to issue CURA-8561.
This commit is contained in:
parent
f498952830
commit
d526e3be8c
@ -59,11 +59,15 @@ Rectangle
|
|||||||
color: UM.Theme.getColor("text")
|
color: UM.Theme.getColor("text")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Row //Row inside row, but the non-layout version skips invisible elements.
|
||||||
|
{
|
||||||
|
spacing: parent.spacing
|
||||||
|
Layout.alignment: Qt.AlignTop
|
||||||
|
|
||||||
UM.RecolorImage
|
UM.RecolorImage
|
||||||
{
|
{
|
||||||
Layout.preferredWidth: visible ? UM.Theme.getSize("section_icon").width : 0
|
width: UM.Theme.getSize("section_icon").width
|
||||||
Layout.preferredHeight: visible ? UM.Theme.getSize("section_icon").height : 0
|
height: UM.Theme.getSize("section_icon").height
|
||||||
Layout.alignment: Qt.AlignTop
|
|
||||||
|
|
||||||
color: UM.Theme.getColor("icon")
|
color: UM.Theme.getColor("icon")
|
||||||
visible: packageData.isVerified
|
visible: packageData.isVerified
|
||||||
@ -74,12 +78,13 @@ Rectangle
|
|||||||
|
|
||||||
Rectangle
|
Rectangle
|
||||||
{ // placeholder for 'certified material' icon+link whenever we implement the materials part of this card
|
{ // placeholder for 'certified material' icon+link whenever we implement the materials part of this card
|
||||||
Layout.preferredWidth: visible ? UM.Theme.getSize("section_icon").width : 0
|
width: UM.Theme.getSize("section_icon").width
|
||||||
Layout.preferredHeight: visible ? UM.Theme.getSize("section_icon").height : 0
|
height: UM.Theme.getSize("section_icon").height
|
||||||
Layout.alignment: Qt.AlignTop
|
|
||||||
|
|
||||||
|
visible: false
|
||||||
// TODO: on hover
|
// TODO: on hover
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user