on xenial help sign in
Merge lp:~aacid/unity8/misc_previewlist_fixes
3cfb2caMichal Hruby
qml/Dash/PreviewListView.qml+6−3
@@ -42,7 +42,7 @@ Item {
42 top: previewListView.bottom
42 top: previewListView.bottom
43 left: parent.left
43 left: parent.left
44 leftMargin: previewListView.categoryDelegate !== undefined && previewListView.categoryDelegate.currentItem ?
44 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
46
46
47 Behavior on leftMargin {
47 Behavior on leftMargin {
48 SmoothedAnimation {
48 SmoothedAnimation {
@@ -115,8 +115,11 @@ Item {
115 if (newContentY < 0) {
115 if (newContentY < 0) {
116 effectAdjust += newContentY;
116 effectAdjust += newContentY;
117 newContentY = 0;
117 newContentY = 0;
118− }
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;
119− if (newContentY > Math.max(0, categoryView.contentHeight - categoryView.height)) {
122+ } else if (newContentY > categoryView.contentHeight - categoryView.height) {
120 effectAdjust += -(categoryView.contentHeight - categoryView.height) + newContentY
123 effectAdjust += -(categoryView.contentHeight - categoryView.height) + newContentY
121 newContentY = categoryView.contentHeight - categoryView.height;
124 newContentY = categoryView.contentHeight - categoryView.height;
122 }
125 }