Folded versus unfolded.

Hide disable/uninstall/install buttons, they're not active anyway and it's not part of this ticket in what state they should be hidden or not. What is part of the folded versus header is the download count row. (Also adapt link color.)

part of CURA-8561
This commit is contained in:
Remco Burema 2021-11-11 18:07:21 +01:00
parent c1f2da8820
commit 82f140aa39
No known key found for this signature in database
GPG Key ID: 215C49431D43F98C

View File

@ -18,6 +18,30 @@ Rectangle
color: UM.Theme.getColor("main_background") color: UM.Theme.getColor("main_background")
radius: UM.Theme.getSize("default_radius").width radius: UM.Theme.getSize("default_radius").width
states:
[
State
{
name: "Folded"
when: true // TODO
PropertyChanges
{
target: downloadCountRow
visible: false
}
},
State
{
name: "Header"
when: false // TODO
PropertyChanges
{
target: downloadCountRow
visible: true
}
}
]
RowLayout RowLayout
{ {
width: parent.width - UM.Theme.getSize("thin_margin").width * 2 width: parent.width - UM.Theme.getSize("thin_margin").width * 2
@ -128,15 +152,23 @@ Rectangle
Button Button
{ {
id: externalLinkButton
Layout.preferredWidth: UM.Theme.getSize("card_tiny_icon").width Layout.preferredWidth: UM.Theme.getSize("card_tiny_icon").width
Layout.preferredHeight: UM.Theme.getSize("card_tiny_icon").height Layout.preferredHeight: UM.Theme.getSize("card_tiny_icon").height
Layout.alignment: Qt.AlignTop Layout.alignment: Qt.AlignTop
UM.RecolorImage Rectangle
{ {
anchors.fill: parent anchors.fill: parent
color: UM.Theme.getColor("icon") color: externalLinkButton.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("detail_background")
source: UM.Theme.getIcon("LinkExternal")
UM.RecolorImage
{
anchors.fill: parent
color: externalLinkButton.hovered ? UM.Theme.getColor("text_link") : UM.Theme.getColor("text")
source: UM.Theme.getIcon("LinkExternal")
}
} }
onClicked: Qt.openUrlExternally(packageData.packageInfoUrl) onClicked: Qt.openUrlExternally(packageData.packageInfoUrl)
@ -145,21 +177,21 @@ Rectangle
RowLayout RowLayout
{ {
width: parent.width - UM.Theme.getSize("thin_margin").width * 2 id: downloadCountRow
width: childrenRect.width
height: childrenRect.height height: childrenRect.height
x: UM.Theme.getSize("thin_margin").width x: UM.Theme.getSize("thin_margin").width
y: UM.Theme.getSize("thin_margin").height y: UM.Theme.getSize("thin_margin").height
spacing: UM.Theme.getSize("thin_margin").width spacing: UM.Theme.getSize("thin_margin").width
enabled: false // remove visible: false // start up invisible (see states)
visible: false // replace w state?
// TODO: hide/unhide on states (folded versus header state)
UM.RecolorImage UM.RecolorImage
{ {
id: downloadCountIcon id: downloadCountIcon
width: UM.Theme.getSize("card_tiny_icon").height width: UM.Theme.getSize("card_tiny_icon").width
height: UM.Theme.getSize("card_tiny_icon").height height: UM.Theme.getSize("card_tiny_icon").height
color: UM.Theme.getColor("icon") color: UM.Theme.getColor("icon")
@ -278,23 +310,26 @@ Rectangle
Cura.SecondaryButton Cura.SecondaryButton
{ {
id: disableButton
Layout.alignment: Qt.AlignTop Layout.alignment: Qt.AlignTop
text: catalog.i18nc("@button", "Disable") text: catalog.i18nc("@button", "Disable")
// not functional right now visible: false // not functional right now, also only when unfolding and required
} }
Cura.SecondaryButton Cura.SecondaryButton
{ {
id: uninstallButton
Layout.alignment: Qt.AlignTop Layout.alignment: Qt.AlignTop
text: catalog.i18nc("@button", "Uninstall") text: catalog.i18nc("@button", "Uninstall")
// not functional right now visible: false // not functional right now, also only when unfolding and required
} }
Cura.PrimaryButton Cura.PrimaryButton
{ {
id: installButton
Layout.alignment: Qt.AlignTop Layout.alignment: Qt.AlignTop
text: catalog.i18nc("@button", "Update") text: catalog.i18nc("@button", "Update") // OR Download, if new!
// not functional right now visible: false // not functional right now, also only when unfolding and required
} }
} }
} }