on xenial help sign in
make tiles square
commitbe09e6c7582ba24827a8f8a3c526a354caa72f26 authorMichael Zanetti <michael.zanetti@canonical.com> dateWed 15 Apr 2015, 15:49 (12 years ago) parent3c241c3
2 files changed+22−17
qml/Stages/DecoratedWindow.qml+11−10 qml/Stages/DesktopStage.qml+11−7
qml/Stages/DecoratedWindow.qml+11−10
@@ -29,10 +29,9 @@ FocusScope {
2929
3030 property bool decorationShown: true
3131 property bool highlightShown: false
32− property real highlightScale: 1
3332
34− property int transformedWidth: width
35− property int transformedHeight: height
33+ property int windowWidth: width
34+ property int windowHeight: height
3635
3736 signal close();
3837 signal maximize();
@@ -43,14 +42,16 @@ FocusScope {
4342 State {
4443 name: "normal"
4544 PropertyChanges {
46− target: applicationWindow
45+ target: root
46+ width: windowWidth
47+ height: windowHeight
4748 }
4849 },
4950 State {
5051 name: "transformed"
5152 PropertyChanges {
5253 target: applicationWindow
53− itemScale: root.transformedWidth / root.width / root.highlightScale
54+ itemScale: Math.max(root.width / root.windowWidth, root.height / root.windowHeight)
5455 }
5556 PropertyChanges {
5657 target: clipper
@@ -72,14 +73,14 @@ FocusScope {
7273 Rectangle {
7374 id: selectionHighlight
7475 anchors.fill: parent
75− anchors.margins: -units.gu(1) * root.highlightScale
76+ anchors.margins: -units.gu(1)
7677 color: "white"
7778 opacity: highlightShown ? 0.15 : 0
7879 }
7980
8081 Rectangle {
8182 anchors { left: selectionHighlight.left; right: selectionHighlight.right; bottom: selectionHighlight.bottom; }
82− height: units.dp(2) * root.highlightScale
83+ height: units.dp(2)
8384 color: UbuntuColors.orange
8485 visible: root.highlightShown
8586 }
@@ -106,12 +107,12 @@ FocusScope {
106107 anchors.top: parent.top
107108 anchors.topMargin: root.decorationShown ? decoration.height : 0
108109 anchors.left: parent.left
109− width: parent.width
110− height: parent.height - (root.decorationShown ? decoration.height : 0)
110+ width: root.windowWidth
111+ height: root.windowHeight - (root.decorationShown ? decoration.height : 0)
111112 interactive: true
112113 focus: true
113114
114− property real itemsScale: 1
115+ property real itemScale: 1
115116 transform: [
116117 Scale {
117118 origin.x: 0; origin.y: 0
qml/Stages/DesktopStage.qml+11−7
@@ -158,10 +158,10 @@ FocusScope {
158158 PropertyChanges {
159159 target: appDelegate
160160 x: spreadMaths.animatedX
161− y: spreadMaths.animatedY
161+ y: spreadMaths.animatedY + (appDelegate.height - decoratedWindow.height)
162162 angle: spreadMaths.animatedAngle
163− itemScale: spreadMaths.scale
164− itemScaleOriginY: appDelegate.height;
163+ //itemScale: spreadMaths.scale
164+ //itemScaleOriginY: appDelegate.height;
165165 z: index
166166 }
167167 PropertyChanges {
@@ -169,6 +169,8 @@ FocusScope {
169169 decorationShown: false
170170 highlightShown: index == appRepeater.highlightedIndex
171171 state: "transformed"
172+ width: spreadMaths.spreadHeight
173+ height: spreadMaths.spreadHeight
172174 }
173175 PropertyChanges {
174176 target: tileInfo
@@ -216,10 +218,12 @@ FocusScope {
216218
217219 DecoratedWindow {
218220 id: decoratedWindow
219− anchors.fill: parent
221+ anchors.left: appDelegate.left
222+ anchors.top: appDelegate.top
223+ windowWidth: appDelegate.width
224+ windowHeight: appDelegate.height
220225 application: ApplicationManager.get(index)
221226 active: ApplicationManager.focusedApplicationId === model.appId
222− highlightScale: 1 / appDelegate.itemScale
223227
224228 onFocusChanged: {
225229 if (focus) {
@@ -239,7 +243,7 @@ FocusScope {
239243 yScale: itemScale
240244 },
241245 Rotation {
242− origin { x: 0; y: (appDelegate.height - (appDelegate.height * itemScale / 2)) }
246+ origin { x: 0; y: (decoratedWindow.height - (decoratedWindow.height * itemScale / 2)) }
243247 axis { x: 0; y: 1; z: 0 }
244248 angle: appDelegate.angle
245249 }
@@ -261,7 +265,7 @@ FocusScope {
261265 ColumnLayout {
262266 id: tileInfo
263267 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) }
265269 visible: false
266270 spacing: units.gu(1)
267271