8import QtQuick.Controls as QQC2
11import org.kde.kirigami as Kirigami
13import org.kde.newstuff as NewStuff
17Private.GridTileDelegate {
20 property var entry: model.entry
22 function showDetails() {
23 pageStack.push(detailsPage, {
29 actionsAnchors.topMargin: bigPreview.height +
Kirigami.Units.smallSpacing * 2
34 icon.name:
"dialog-ok-apply"
35 onTriggered: source => {
36 newStuffModel.engine.adoptEntry(model.entry);
38 enabled: (entry.status === NewStuff.Entry.Installed || entry.status === NewStuff.Entry.Updateable) && newStuffEngine.hasAdoptionCommand
42 text: model.downloadLinks.length === 1
43 ?
i18ndc(
"knewstuff6",
"Request installation of this item, available when there is exactly one downloadable item",
"Install")
44 :
i18ndc(
"knewstuff6",
"Show installation options, where there is more than one downloadable item",
"Install…")
46 onTriggered: source => {
47 if (model.downloadLinks.length === 1) {
48 newStuffModel.engine.installLinkId(model.entry, NewStuff.ItemsModel.FirstLinkId);
50 downloadItemsSheet.downloadLinks = model.downloadLinks;
51 downloadItemsSheet.entry = model.entry;
52 downloadItemsSheet.open();
55 enabled: entry.status === NewStuff.Entry.Downloadable || entry.status === NewStuff.Entry.Deleted
59 text:
i18ndc(
"knewstuff6",
"Request updating of this item",
"Update")
60 icon.name: "update-none"
61 onTriggered: source => {
62 newStuffModel.engine.installLatest(model.entry);
64 enabled: entry.status === NewStuff.Entry.Updateable
68 text: root.uninstallLabel
69 icon.name:
"edit-delete"
70 onTriggered: source => {
71 newStuffModel.engine.uninstall(model.entry);
73 enabled: entry.status === NewStuff.Entry.Installed || entry.status === NewStuff.Entry.Updateable
77 thumbnailArea: bigPreview
78 thumbnailAvailable: model.previewsSmall.length > 0
87 Layout.fillWidth:
true
88 Layout.fillHeight:
true
89 Layout.minimumHeight: width / 5
90 Layout.maximumHeight: width / 1.8
92 visible: bigPreview.status === Image.Ready
93 anchors.centerIn: bigPreview
94 width: Math.min(bigPreview.paintedWidth, bigPreview.width)
95 height: Math.min(bigPreview.paintedHeight, bigPreview.height)
98 shadow.color:
Qt.rgba(0, 0, 0, 0.3)
103 fillMode: Image.PreserveAspectCrop
104 source: thumbnailAvailable ? model.previews[0] :
""
108 id: updateAvailableBadge
109 opacity: (entry.status === NewStuff.Entry.Updateable) ? 1 : 0
110 Behavior on opacity { NumberAnimation { duration:
Kirigami.
Units.shortDuration } }
117 source:
"package-installed-outdated"
121 opacity: (entry.
status === NewStuff.Entry.Installed) ? 1 : 0
122 Behavior on opacity { NumberAnimation { duration:
Kirigami.
Units.shortDuration; } }
127 height:
Kirigami.Units.iconSizes.medium
129 source:
"package-installed-updated"
133 Layout.fillWidth:
true
137 Layout.fillWidth:
true
139 elide:
Text.ElideRight
140 text:
i18ndc(
"knewstuff6",
"The number of times the item has been downloaded",
"%1 downloads", model.downloadCount)
143 Layout.fillWidth:
true
144 elide:
Text.ElideRight
149 Layout.fillWidth:
true
150 elide:
Text.ElideRight
152 textFormat:
Text.StyledText
153 text:
i18ndc(
"knewstuff6",
"Subheading for the tile view, located immediately underneath the name of the item",
"By <i>%1</i>", model.author.name)
156 Layout.fillWidth:
true
157 Layout.fillHeight:
true
158 Layout.minimumHeight:
Kirigami.Units.gridUnit
159 Layout.maximumHeight:
Kirigami.Units.gridUnit * 3
161 text: model.shortSummary.length > 0 ? model.shortSummary : model.summary
162 elide:
Text.ElideRight
168 newStuffModel: component.GridView.view.model
172 cursorShape:
Qt.PointingHandCursor
173 onClicked: mouse => {
174 component.showDetails();
Q_SCRIPTABLE CaptureState status()
QString i18ndc(const char *domain, const char *context, const char *text, const TYPE &arg...)
QStringView level(QStringView ifopt)
QString name(StandardAction id)
QTextStream & left(QTextStream &stream)