on xenial help sign in
CategoryDelegateRange: Fix condition for detecting overshooting
commitec0a69d801909e816857125a977858cdbe50334e authorAlbert Astals <albert.astals@canonical.com> dateTue 29 Apr 2014, 15:17 (12 years ago) parentc2125ecd31b0c9
1 file changed+9−6
qml/Dash/GenericScopeView.qml+9−6
qml/Dash/GenericScopeView.qml+9−6
@@ -238,12 +238,15 @@ FocusScope {
238238 }
239239
240240 function updateDelegateCreationRange() {
241− // Do not update the range if we are overshooting up or down, since we'll come back
242− // to the stable position and delete/create items without any reason
243− if (categoryView.contentY < categoryView.originY) {
244− return;
245− } else if (categoryView.contentHeight > categoryView.height && categoryView.contentY + categoryView.height > categoryView.contentHeight) {
246− return;
241+ if (categoryView.moving) {
242+ // Do not update the range if we are overshooting up or down, since we'll come back
243+ // to the stable position and delete/create items without any reason
244+ if (categoryView.contentY < categoryView.originY) {
245+ return;
246+ } else if (categoryView.contentHeight - categoryView.originY > categoryView.height &&
247+ categoryView.contentY + categoryView.height > categoryView.contentHeight) {
248+ return;
249+ }
247250 }
248251
249252 if (item && item.hasOwnProperty("delegateCreationBegin")) {