Commit ae1e7105 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Use the delegateRecycler variable to find the ListView attached object

parent b657ff2b
...@@ -22,7 +22,7 @@ import QtQuick.Controls 2.1 ...@@ -22,7 +22,7 @@ import QtQuick.Controls 2.1
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Window 2.1 import QtQuick.Window 2.1
import "navigation.js" as Navigation import "navigation.js" as Navigation
import org.kde.kirigami 2.4 as Kirigami import org.kde.kirigami 2.6 as Kirigami
Kirigami.AbstractCard Kirigami.AbstractCard
{ {
...@@ -31,14 +31,13 @@ Kirigami.AbstractCard ...@@ -31,14 +31,13 @@ Kirigami.AbstractCard
property bool compact: false property bool compact: false
property bool showRating: true property bool showRating: true
showClickFeedback: true showClickFeedback: true
property var view: null
function trigger() { function trigger() {
if (view) if (delegateRecycler.ListView.view)
view.currentIndex = index delegateRecycler.ListView.view.currentIndex = index
Navigation.openApplication(application) Navigation.openApplication(application)
} }
highlighted: ListView.isCurrentItem highlighted: delegateRecycler.ListView.isCurrentItem
Keys.onReturnPressed: trigger() Keys.onReturnPressed: trigger()
onClicked: trigger() onClicked: trigger()
......
...@@ -149,7 +149,6 @@ DiscoverPage { ...@@ -149,7 +149,6 @@ DiscoverPage {
application: model.application application: model.application
compact: page.compact compact: page.compact
showRating: page.showRating showRating: page.showRating
view: apps
} }
Label { Label {
......
...@@ -53,7 +53,6 @@ DiscoverPage ...@@ -53,7 +53,6 @@ DiscoverPage
delegate: ApplicationDelegate { delegate: ApplicationDelegate {
application: model.application application: model.application
compact: page.compact compact: page.compact
view: apps
} }
footer: Kirigami.Heading { footer: Kirigami.Heading {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment