on xenial help sign in
Merge lp:~aacid/unity8/misc_previewlist_fixes
commit3cfb2ca78487ec1d7e07f2d41dc9a3f83bd69d31 authorMichal Hruby <michal.mhr@gmail.com> dateFri 14 Feb 2014, 13:10 (13 years ago) parentb3e618057ffa2c
1 file changed+6−3
qml/Dash/PreviewListView.qml+6−3
qml/Dash/PreviewListView.qml+6−3
@@ -42,7 +42,7 @@ Item {
4242 top: previewListView.bottom
4343 left: parent.left
4444 leftMargin: previewListView.categoryDelegate !== undefined && previewListView.categoryDelegate.currentItem ?
45− previewListView.categoryDelegate.currentItem.center + (-width + margins) / 2 : 0
45+ previewListView.categoryDelegate.currentItem.x + previewListView.categoryDelegate.currentItem.width / 2 + (-width + margins) / 2 : 0
4646
4747 Behavior on leftMargin {
4848 SmoothedAnimation {
@@ -115,8 +115,11 @@ Item {
115115 if (newContentY < 0) {
116116 effectAdjust += newContentY;
117117 newContentY = 0;
118− }
119− if (newContentY > Math.max(0, categoryView.contentHeight - categoryView.height)) {
118+ } else if (categoryView.contentHeight < categoryView.height) {
119+ // We can't change contentY if the content is smaller than the view, so adjust effect position
120+ effectAdjust += newContentY;
121+ newContentY = 0;
122+ } else if (newContentY > categoryView.contentHeight - categoryView.height) {
120123 effectAdjust += -(categoryView.contentHeight - categoryView.height) + newContentY
121124 newContentY = categoryView.contentHeight - categoryView.height;
122125 }