on xenial help sign in
make tiles square
be09e6cMichael Zanetti
qml/Stages/DecoratedWindow.qml+11−10
@@ -29,10 +29,9 @@ FocusScope {
29
29
30 property bool decorationShown: true
30 property bool decorationShown: true
31 property bool highlightShown: false
31 property bool highlightShown: false
32− property real highlightScale: 1
33
32
34− property int transformedWidth: width
33+ property int windowWidth: width
35− property int transformedHeight: height
34+ property int windowHeight: height
36
35
37 signal close();
36 signal close();
38 signal maximize();
37 signal maximize();
@@ -43,14 +42,16 @@ FocusScope {
43 State {
42 State {
44 name: "normal"
43 name: "normal"
45 PropertyChanges {
44 PropertyChanges {
46− target: applicationWindow
45+ target: root
46+ width: windowWidth
47+ height: windowHeight
47 }
48 }
48 },
49 },
49 State {
50 State {
50 name: "transformed"
51 name: "transformed"
51 PropertyChanges {
52 PropertyChanges {
52 target: applicationWindow
53 target: applicationWindow
53− itemScale: root.transformedWidth / root.width / root.highlightScale
54+ itemScale: Math.max(root.width / root.windowWidth, root.height / root.windowHeight)
54 }
55 }
55 PropertyChanges {
56 PropertyChanges {
56 target: clipper
57 target: clipper
@@ -72,14 +73,14 @@ FocusScope {
72 Rectangle {
73 Rectangle {
73 id: selectionHighlight
74 id: selectionHighlight
74 anchors.fill: parent
75 anchors.fill: parent
75− anchors.margins: -units.gu(1) * root.highlightScale
76+ anchors.margins: -units.gu(1)
76 color: "white"
77 color: "white"
77 opacity: highlightShown ? 0.15 : 0
78 opacity: highlightShown ? 0.15 : 0
78 }
79 }
79
80
80 Rectangle {
81 Rectangle {
81 anchors { left: selectionHighlight.left; right: selectionHighlight.right; bottom: selectionHighlight.bottom; }
82 anchors { left: selectionHighlight.left; right: selectionHighlight.right; bottom: selectionHighlight.bottom; }
82− height: units.dp(2) * root.highlightScale
83+ height: units.dp(2)
83 color: UbuntuColors.orange
84 color: UbuntuColors.orange
84 visible: root.highlightShown
85 visible: root.highlightShown
85 }
86 }
@@ -106,12 +107,12 @@ FocusScope {
106 anchors.top: parent.top
107 anchors.top: parent.top
107 anchors.topMargin: root.decorationShown ? decoration.height : 0
108 anchors.topMargin: root.decorationShown ? decoration.height : 0
108 anchors.left: parent.left
109 anchors.left: parent.left
109− width: parent.width
110+ width: root.windowWidth
110− height: parent.height - (root.decorationShown ? decoration.height : 0)
111+ height: root.windowHeight - (root.decorationShown ? decoration.height : 0)
111 interactive: true
112 interactive: true
112 focus: true
113 focus: true
113
114
114− property real itemsScale: 1
115+ property real itemScale: 1
115 transform: [
116 transform: [
116 Scale {
117 Scale {
117 origin.x: 0; origin.y: 0
118 origin.x: 0; origin.y: 0
qml/Stages/DesktopStage.qml+11−7
@@ -158,10 +158,10 @@ FocusScope {
158 PropertyChanges {
158 PropertyChanges {
159 target: appDelegate
159 target: appDelegate
160 x: spreadMaths.animatedX
160 x: spreadMaths.animatedX
161− y: spreadMaths.animatedY
161+ y: spreadMaths.animatedY + (appDelegate.height - decoratedWindow.height)
162 angle: spreadMaths.animatedAngle
162 angle: spreadMaths.animatedAngle
163− itemScale: spreadMaths.scale
163+ //itemScale: spreadMaths.scale
164− itemScaleOriginY: appDelegate.height;
164+ //itemScaleOriginY: appDelegate.height;
165 z: index
165 z: index
166 }
166 }
167 PropertyChanges {
167 PropertyChanges {
@@ -169,6 +169,8 @@ FocusScope {
169 decorationShown: false
169 decorationShown: false
170 highlightShown: index == appRepeater.highlightedIndex
170 highlightShown: index == appRepeater.highlightedIndex
171 state: "transformed"
171 state: "transformed"
172+ width: spreadMaths.spreadHeight
173+ height: spreadMaths.spreadHeight
172 }
174 }
173 PropertyChanges {
175 PropertyChanges {
174 target: tileInfo
176 target: tileInfo
@@ -216,10 +218,12 @@ FocusScope {
216
218
217 DecoratedWindow {
219 DecoratedWindow {
218 id: decoratedWindow
220 id: decoratedWindow
219− anchors.fill: parent
221+ anchors.left: appDelegate.left
222+ anchors.top: appDelegate.top
223+ windowWidth: appDelegate.width
224+ windowHeight: appDelegate.height
220 application: ApplicationManager.get(index)
225 application: ApplicationManager.get(index)
221 active: ApplicationManager.focusedApplicationId === model.appId
226 active: ApplicationManager.focusedApplicationId === model.appId
222− highlightScale: 1 / appDelegate.itemScale
223
227
224 onFocusChanged: {
228 onFocusChanged: {
225 if (focus) {
229 if (focus) {
@@ -239,7 +243,7 @@ FocusScope {
239 yScale: itemScale
243 yScale: itemScale
240 },
244 },
241 Rotation {
245 Rotation {
242− origin { x: 0; y: (appDelegate.height - (appDelegate.height * itemScale / 2)) }
246+ origin { x: 0; y: (decoratedWindow.height - (decoratedWindow.height * itemScale / 2)) }
243 axis { x: 0; y: 1; z: 0 }
247 axis { x: 0; y: 1; z: 0 }
244 angle: appDelegate.angle
248 angle: appDelegate.angle
245 }
249 }
@@ -261,7 +265,7 @@ FocusScope {
261 ColumnLayout {
265 ColumnLayout {
262 id: tileInfo
266 id: tileInfo
263 width: units.gu(30)
267 width: units.gu(30)
264− anchors { left: parent.left; top: parent.bottom; topMargin: units.gu(5) }
268+ anchors { left: parent.left; top: decoratedWindow.bottom; topMargin: units.gu(5) }
265 visible: false
269 visible: false
266 spacing: units.gu(1)
270 spacing: units.gu(1)
267
271