on xenial help sign in
some improvements
commit67df0910dfaf0df64e0d435ab01210384e8291b5 authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 9 Mar 2017, 14:14 (10 years ago) parentab4ffb8
3 files changed+12−7
qml/Stage/Spread/ScreensAndWorkspaces.qml+8−1 qml/Stage/Spread/Spread.qml+1−2 qml/Stage/Spread/Workspaces.qml+3−4
qml/Stage/Spread/ScreensAndWorkspaces.qml+8−1
@@ -106,7 +106,14 @@ Item {
106106 Workspaces {
107107 id: workspaces
108108 height: parent.height - header.height - units.gu(2)
109− width: Math.min(implicitWidth, index == 0 ? units.gu(80) : units.gu(40), root.width)
109+ width: {
110+ if (screensProxy.count == 0) {
111+ return Math.min(implicitWidth, root.width - units.gu(8));
112+ }
113+ // TODO: needs better logic: If this is the active/current screen, make it wide, otherwise narrow
114+ return Math.min(implicitWidth, index == 0 ? units.gu(80) : units.gu(40), root.width)
115+ }
116+
110117 Behavior on width { UbuntuNumberAnimation {} }
111118 anchors.bottom: parent.bottom
112119 anchors.bottomMargin: units.gu(1)
qml/Stage/Spread/Spread.qml+1−2
@@ -93,8 +93,7 @@ Item {
9393
9494 readonly property real spreadTotalWidth: Math.max(2,totalItemCount) * spreadWidth / visibleItemCount
9595
96− readonly property real centeringOffset: Math.max(spreadWidth - spreadTotalWidth ,0) / (2 * spreadWidth)
97−
96+ readonly property real centeringOffset: Math.max(spreadWidth - spreadTotalWidth + leftStackXPos * 2, 0) / (2 * spreadWidth)
9897
9998 readonly property var curve: BezierCurve {
10099 controlPoint2: {'x': 0.19, 'y': 0.00}
qml/Stage/Spread/Workspaces.qml+3−4
@@ -6,8 +6,7 @@ import "../../Components"
66
77Item {
88 id: root
9− implicitWidth: listView.count * (height * 16/9 + listView.spacing) - listView.spacing
10−// color: "blue"
9+ implicitWidth: listView.contentWidth
1110
1211 property QtObject screen: null
1312 property alias workspaceModel: listView.model
@@ -71,7 +70,7 @@ Item {
7170 leftMargin: itemWidth
7271 rightMargin: itemWidth
7372
74− property int itemWidth: height * 16 / 9
73+ property int itemWidth: height * screen.physicalSize.width / screen.physicalSize.height
7574 property int foldingAreaWidth: units.gu(10)
7675 property real realContentX: contentX - originX + leftMargin
7776 property int dropItemIndex: -1
@@ -264,7 +263,7 @@ Item {
264263 }
265264
266265 onClicked: {
267− WorkspaceManager.activeWorkspace = fakeDragItem.workspace
266+ screenWindow.screen.activeWorkspace = fakeDragItem.workspace
268267 }
269268
270269 WorkspacePreview {