on xenial help sign in
fix close button and focusing for real
commitd5a493ff25a9f1ed7486f0c18118b426dfd19d81 authorMichael Zanetti <michael.zanetti@canonical.com> dateWed 3 Jun 2015, 15:40 (11 years ago) parent4872f9a
1 file changed+22−4
qml/Stages/DesktopStage.qml+22−4
qml/Stages/DesktopStage.qml+22−4
@@ -158,7 +158,7 @@ Rectangle {
158158 readonly property int minHeight: units.gu(10)
159159
160160 onFocusChanged: {
161− if (focus && !ApplicationManager.focusedApplicationId === model.appId) {
161+ if (focus && ApplicationManager.focusedApplicationId !== model.appId) {
162162 ApplicationManager.requestFocusApplication(model.appId);
163163 }
164164 }
@@ -274,10 +274,28 @@ Rectangle {
274274 id: spreadSelectArea
275275 anchors.fill: parent
276276 enabled: false
277− hoverEnabled: true
278− property bool upperThirdContainsMouse: containsMouse && mouseY < height / 3
277+ hoverEnabled: enabled
278+
279+ // There is a bug in MouseArea where containsMouse doesn't
280+ // return to false if the MouseArea is disabled while
281+ // containing the mouse. Let's manage the property our own.
282+ property bool upperThirdContainsMouse: false
283+ onContainsMouseChanged: evaluateUpperThirdContainsMouse()
284+ onMouseYChanged: evaluateUpperThirdContainsMouse()
285+ function evaluateUpperThirdContainsMouse() {
286+ if (containsMouse && mouseY < height / 3) {
287+ spreadSelectArea.upperThirdContainsMouse = true
288+ } else {
289+ spreadSelectArea.upperThirdContainsMouse = false;
290+ }
291+ }
292+ onEnabledChanged: {
293+ if (!enabled) {
294+ spreadSelectArea.upperThirdContainsMouse = false
295+ }
296+ }
297+
279298 onClicked: {
280− print("clicked")
281299 appDelegate.focus = true
282300 root.state = ""
283301 }