on xenial help sign in
improve close button visiblity when hovering with the mouse

Approved by: Albert Astals Cid, Unity8 CI Bot

commitd9ebe23e861c8305bb0e2c8f930433d6abece062 authorMichael Zanetti <michael.zanetti@canonical.com> dateWed 7 Dec 2016, 13:44 (10 years ago) parente828c8b7ffdfb4
1 file changed+23−23
qml/Stage/Stage.qml+23−23
qml/Stage/Stage.qml+23−23
@@ -1650,10 +1650,10 @@ FocusScope {
16501650 }
16511651 }
16521652
1653− Image {
1654− id: closeImage
1653+ MouseArea {
1654+ id: closeMouseArea
1655+ objectName: "closeMouseArea"
16551656 anchors { left: parent.left; top: parent.top; leftMargin: -height / 2; topMargin: -height / 2 + spreadMaths.closeIconOffset }
1656− source: "graphics/window-close.svg"
16571657 readonly property var mousePos: hoverMouseArea.mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
16581658 visible: !appDelegate.isDash && dragArea.distance == 0
16591659 && index == spreadItem.highlightedIndex
@@ -1661,20 +1661,20 @@ FocusScope {
16611661 && mousePos.y > -units.gu(4)
16621662 && mousePos.x > -units.gu(4)
16631663 && mousePos.x < (decoratedWindow.width * 2 / 3)
1664− height: units.gu(2)
1664+ height: units.gu(6)
16651665 width: height
1666− sourceSize.width: width
1667− sourceSize.height: height
1668−
1669− MouseArea {
1670− id: closeMouseArea
1671− objectName: "closeMouseArea"
1672− anchors.fill: closeImage
1673− anchors.margins: -units.gu(2)
1674− onClicked: {
1675− priv.closingIndex = index;
1676− appDelegate.close();
1677− }
1666+
1667+ onClicked: {
1668+ priv.closingIndex = index;
1669+ appDelegate.close();
1670+ }
1671+ Image {
1672+ id: closeImage
1673+ source: "graphics/window-close.svg"
1674+ anchors.fill: closeMouseArea
1675+ anchors.margins: units.gu(2)
1676+ sourceSize.width: width
1677+ sourceSize.height: height
16781678 }
16791679 }
16801680 }
@@ -1733,13 +1733,13 @@ FocusScope {
17331733 }
17341734
17351735 // Find the hovered item and mark it active
1736− var mapped = mapToItem(appContainer, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
1737− var itemUnder = appContainer.childAt(mapped.x, mapped.y)
1738− if (itemUnder) {
1739− mapped = mapToItem(itemUnder, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
1740− var delegateChild = itemUnder.childAt(mapped.x, mapped.y)
1741− if (delegateChild && (delegateChild.objectName === "dragArea" || delegateChild.objectName === "windowInfoItem")) {
1742− spreadItem.highlightedIndex = appRepeater.indexOf(itemUnder)
1736+ for (var i = appRepeater.count - 1; i >= 0; i--) {
1737+ var appDelegate = appRepeater.itemAt(i);
1738+ var mapped = mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
1739+ var itemUnder = appDelegate.childAt(mapped.x, mapped.y);
1740+ if (itemUnder && (itemUnder.objectName === "dragArea" || itemUnder.objectName === "windowInfoItem" || itemUnder.objectName == "closeMouseArea")) {
1741+ spreadItem.highlightedIndex = i;
1742+ break;
17431743 }
17441744 }
17451745