mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-15 13:45:52 +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,26 +59,31 @@ Rectangle
|
|||||||
color: UM.Theme.getColor("text")
|
color: UM.Theme.getColor("text")
|
||||||
}
|
}
|
||||||
|
|
||||||
UM.RecolorImage
|
Row //Row inside row, but the non-layout version skips invisible elements.
|
||||||
{
|
{
|
||||||
Layout.preferredWidth: visible ? UM.Theme.getSize("section_icon").width : 0
|
spacing: parent.spacing
|
||||||
Layout.preferredHeight: visible ? UM.Theme.getSize("section_icon").height : 0
|
|
||||||
Layout.alignment: Qt.AlignTop
|
Layout.alignment: Qt.AlignTop
|
||||||
|
|
||||||
color: UM.Theme.getColor("icon")
|
UM.RecolorImage
|
||||||
visible: packageData.isVerified
|
{
|
||||||
source: UM.Theme.getIcon("CheckCircle")
|
width: UM.Theme.getSize("section_icon").width
|
||||||
|
height: UM.Theme.getSize("section_icon").height
|
||||||
|
|
||||||
// TODO: on hover
|
color: UM.Theme.getColor("icon")
|
||||||
}
|
visible: packageData.isVerified
|
||||||
|
source: UM.Theme.getIcon("CheckCircle")
|
||||||
|
|
||||||
Rectangle
|
// TODO: on hover
|
||||||
{ // 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
|
|
||||||
Layout.preferredHeight: visible ? UM.Theme.getSize("section_icon").height : 0
|
|
||||||
Layout.alignment: Qt.AlignTop
|
|
||||||
|
|
||||||
// TODO: on hover
|
Rectangle
|
||||||
|
{ // placeholder for 'certified material' icon+link whenever we implement the materials part of this card
|
||||||
|
width: UM.Theme.getSize("section_icon").width
|
||||||
|
height: UM.Theme.getSize("section_icon").height
|
||||||
|
|
||||||
|
visible: false
|
||||||
|
// TODO: on hover
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Label
|
Label
|
||||||
|
Loading…
x
Reference in New Issue
Block a user