on xenial help sign in
spice it up with fancy cursor shapes :)
1aaa701Lukáš Tinkl
qml/Stages/ResizeGrip.qml+2
@@ -25,6 +25,7 @@ Rectangle {
25
25
26 // to be set from outside
26 // to be set from outside
27 property Item resizeTarget
27 property Item resizeTarget
28+ property alias cursorShape: mouseArea.cursorShape
28
29
29 Image {
30 Image {
30 source: "graphics/arrows.png"
31 source: "graphics/arrows.png"
@@ -34,6 +35,7 @@ Rectangle {
34 }
35 }
35
36
36 MouseArea {
37 MouseArea {
38+ id: mouseArea
37 anchors.fill: parent
39 anchors.fill: parent
38 hoverEnabled: true
40 hoverEnabled: true
39
41
qml/Stages/WindowControlsOverlay.qml+9
@@ -61,6 +61,7 @@ Item {
61 visible: overlay.visible
61 visible: overlay.visible
62 enabled: visible
62 enabled: visible
63 hoverEnabled: true
63 hoverEnabled: true
64+ cursorShape: priv.dragging ? Qt.ClosedHandCursor : (overlay.visible ? Qt.OpenHandCursor : Qt.ArrowCursor)
64
65
65 onPressedChanged: {
66 onPressedChanged: {
66 if (pressed) {
67 if (pressed) {
@@ -119,6 +120,7 @@ Item {
119 anchors.verticalCenterOffset: borderThickness
120 anchors.verticalCenterOffset: borderThickness
120 visible: !overlay.anyMaximized
121 visible: !overlay.anyMaximized
121 resizeTarget: root.resizeTarget
122 resizeTarget: root.resizeTarget
123+ cursorShape: Qt.SizeFDiagCursor
122 }
124 }
123
125
124 ResizeGrip { // top center
126 ResizeGrip { // top center
@@ -128,6 +130,7 @@ Item {
128 rotation: 45
130 rotation: 45
129 visible: !overlay.anyMaximized
131 visible: !overlay.anyMaximized
130 resizeTarget: root.resizeTarget
132 resizeTarget: root.resizeTarget
133+ cursorShape: Qt.SizeVerCursor
131 }
134 }
132
135
133 ResizeGrip { // top right
136 ResizeGrip { // top right
@@ -138,6 +141,7 @@ Item {
138 rotation: 90
141 rotation: 90
139 visible: !overlay.anyMaximized
142 visible: !overlay.anyMaximized
140 resizeTarget: root.resizeTarget
143 resizeTarget: root.resizeTarget
144+ cursorShape: Qt.SizeBDiagCursor
141 }
145 }
142
146
143 ResizeGrip { // right
147 ResizeGrip { // right
@@ -147,6 +151,7 @@ Item {
147 rotation: 135
151 rotation: 135
148 visible: target && !target.maximizedRight && !target.maximized
152 visible: target && !target.maximizedRight && !target.maximized
149 resizeTarget: root.resizeTarget
153 resizeTarget: root.resizeTarget
154+ cursorShape: Qt.SizeHorCursor
150 }
155 }
151
156
152 ResizeGrip { // bottom right
157 ResizeGrip { // bottom right
@@ -156,6 +161,7 @@ Item {
156 anchors.verticalCenterOffset: -borderThickness
161 anchors.verticalCenterOffset: -borderThickness
157 visible: !overlay.anyMaximized
162 visible: !overlay.anyMaximized
158 resizeTarget: root.resizeTarget
163 resizeTarget: root.resizeTarget
164+ cursorShape: Qt.SizeFDiagCursor
159 }
165 }
160
166
161 ResizeGrip { // bottom center
167 ResizeGrip { // bottom center
@@ -165,6 +171,7 @@ Item {
165 rotation: 45
171 rotation: 45
166 visible: !overlay.anyMaximized
172 visible: !overlay.anyMaximized
167 resizeTarget: root.resizeTarget
173 resizeTarget: root.resizeTarget
174+ cursorShape: Qt.SizeVerCursor
168 }
175 }
169
176
170 ResizeGrip { // bottom left
177 ResizeGrip { // bottom left
@@ -175,6 +182,7 @@ Item {
175 rotation: 90
182 rotation: 90
176 visible: !overlay.anyMaximized
183 visible: !overlay.anyMaximized
177 resizeTarget: root.resizeTarget
184 resizeTarget: root.resizeTarget
185+ cursorShape: Qt.SizeBDiagCursor
178 }
186 }
179
187
180 ResizeGrip { // left
188 ResizeGrip { // left
@@ -184,6 +192,7 @@ Item {
184 rotation: 135
192 rotation: 135
185 visible: target && !target.maximizedLeft && !target.maximized
193 visible: target && !target.maximizedLeft && !target.maximized
186 resizeTarget: root.resizeTarget
194 resizeTarget: root.resizeTarget
195+ cursorShape: Qt.SizeHorCursor
187 }
196 }
188 }
197 }
189}
198}