Delay some delegate removals to reduce CPU spent on recalculating sizes

run-ci
Nicolas Werner 2 years ago
parent 696419c4f6
commit ef31f67c32
No known key found for this signature in database
GPG Key ID: C8D75E610773F2D9
  1. 2
      resources/qml/Completer.qml
  2. 1
      resources/qml/MessageView.qml

@ -125,6 +125,8 @@ Control {
delegate: Rectangle { delegate: Rectangle {
property variant modelData: model property variant modelData: model
ListView.delayRemove: true
color: model.index == popup.currentIndex ? Nheko.colors.highlight : Nheko.colors.base color: model.index == popup.currentIndex ? Nheko.colors.highlight : Nheko.colors.base
height: chooser.child.implicitHeight + 2 * popup.rowMargin height: chooser.child.implicitHeight + 2 * popup.rowMargin
implicitWidth: fullWidth ? ListView.view.width : chooser.child.implicitWidth + 4 implicitWidth: fullWidth ? ListView.view.width : chooser.child.implicitWidth + 4

@ -449,6 +449,7 @@ Item {
anchors.horizontalCenter: parent ? parent.horizontalCenter : undefined anchors.horizontalCenter: parent ? parent.horizontalCenter : undefined
width: chat.delegateMaxWidth width: chat.delegateMaxWidth
height: section.active ? section.height + timelinerow.height : timelinerow.height height: section.active ? section.height + timelinerow.height : timelinerow.height
ListView.delayRemove: true
Loader { Loader {
id: section id: section

Loading…
Cancel
Save