mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07: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
1 changed files with 19 additions and 14 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue