mirror of https://github.com/KDE/kasts.git
Switch from DelegateRecycler to reuseItems (except for queue)
This commit is contained in:
parent
06e8d8d573
commit
4a20959522
|
@ -4,7 +4,7 @@
|
||||||
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import QtQuick 2.14
|
import QtQuick 2.15
|
||||||
import QtQuick.Controls 2.15 as Controls
|
import QtQuick.Controls 2.15 as Controls
|
||||||
import QtQuick.Layouts 1.14
|
import QtQuick.Layouts 1.14
|
||||||
|
|
||||||
|
@ -78,14 +78,13 @@ Kirigami.ScrollablePage {
|
||||||
}
|
}
|
||||||
ListView {
|
ListView {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
reuseItems: true
|
||||||
|
|
||||||
model: PodcastSearchModel {
|
model: PodcastSearchModel {
|
||||||
id: podcastSearchModel
|
id: podcastSearchModel
|
||||||
}
|
}
|
||||||
spacing: 5
|
spacing: 5
|
||||||
clip: true
|
clip: true
|
||||||
delegate: Kirigami.DelegateRecycler {
|
delegate: delegateComponent
|
||||||
width: parent ? parent.width : implicitWidth
|
|
||||||
sourceComponent: delegateComponent
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,13 +131,9 @@ Kirigami.ScrollablePage {
|
||||||
id: episodeList
|
id: episodeList
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
visible: count !== 0
|
visible: count !== 0
|
||||||
model: episodeProxyModel
|
reuseItems: true
|
||||||
|
|
||||||
// TODO: seems like reuseItems is way too slow; using DelegateRecycler
|
model: episodeProxyModel
|
||||||
// for now; still have to find out why...
|
delegate: episodeListDelegate
|
||||||
delegate: Kirigami.DelegateRecycler {
|
|
||||||
width: episodeList.width
|
|
||||||
sourceComponent: episodeListDelegate
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import QtQuick 2.14
|
import QtQuick 2.15
|
||||||
import QtQuick.Controls 2.14 as Controls
|
import QtQuick.Controls 2.15 as Controls
|
||||||
import QtQuick.Layouts 1.14
|
import QtQuick.Layouts 1.14
|
||||||
import QtGraphicalEffects 1.15
|
import QtGraphicalEffects 1.15
|
||||||
|
|
||||||
|
@ -45,6 +45,8 @@ Kirigami.OverlaySheet {
|
||||||
id: errorList
|
id: errorList
|
||||||
visible: errorList.count > 0
|
visible: errorList.count > 0
|
||||||
implicitWidth: Kirigami.Units.gridUnit * 20
|
implicitWidth: Kirigami.Units.gridUnit * 20
|
||||||
|
reuseItems: true
|
||||||
|
|
||||||
model: ErrorLogModel
|
model: ErrorLogModel
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
|
@ -89,10 +91,7 @@ Kirigami.OverlaySheet {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delegate: Kirigami.DelegateRecycler {
|
delegate: errorListDelegate
|
||||||
width: errorList.width
|
|
||||||
sourceComponent: errorListDelegate
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
contentItem: errorList.count > 0 ? errorList : placeholder
|
contentItem: errorList.count > 0 ? errorList : placeholder
|
||||||
|
|
Loading…
Reference in New Issue