Commit ab26ebb1 authored by Eike Hein's avatar Eike Hein

Compress calls to `updateSize`

Summary:
Repeater+Flow has no reliable way to transactionize/batch insertion,
e.g. `Flow.positionCompleted` is useless in a function that can change
the Flow's size, and transition events like populated and similar
aren't available. Refactoring this to be a ListView isn't appealing
because it would mean the code loses the property of being reused for
both the bar and the popup, and therefore is well-tested already.

This brings down the number of `updateSize` calls when opening the
dialog for a group of five from five to one.

BUG:400364

Reviewers: #plasma, davidedmundson

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D17006
parent 5d253b01
......@@ -127,7 +127,7 @@ PlasmaCore.Dialog {
onAnimatingChanged: {
if (!animating) {
updateSize();
Qt.callLater(updateSize);
}
}
......@@ -146,11 +146,11 @@ PlasmaCore.Dialog {
return -1;
}
onItemAdded: updateSize()
onItemAdded: Qt.callLater(updateSize)
onItemRemoved: {
if (groupDialog.visible && index > 0 && index == count) {
updateSize();
Qt.callLater(updateSize);
}
}
}
......@@ -262,7 +262,7 @@ PlasmaCore.Dialog {
// Setting VisualDataModel.rootIndex drops groupRepeater.count to 0
// before the actual row count. updateSize is therefore invoked twice;
// only update size once the repeater count matches the model role.
} else if (!groupRepeater.aboutToPopulate || visualParent.childCount == groupRepeater.count) {
} else if (!groupRepeater.aboutToPopulate && visualParent.childCount == groupRepeater.count) {
var task;
var maxWidth = 0;
var maxHeight = 0;
......
......@@ -469,7 +469,7 @@ Item {
return false;
}
if (!main.GridView.view.isRootView && main.GridView.view.dialog.containsDrag) {
if (!main.GridView.view.isRootView && main.GridView.view.dialog && main.GridView.view.dialog.containsDrag) {
return false;
}
......
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