From 93cf399fd6667ea74108af842dd3b81b75d60766 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Mon, 16 Apr 2018 15:07:45 -0700 Subject: [PATCH 1/2] Only dismiss letterbox when clicking on grey areas --- .../resources/qml/hifi/LetterboxMessage.qml | 41 ++++++++++++++++++- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/interface/resources/qml/hifi/LetterboxMessage.qml b/interface/resources/qml/hifi/LetterboxMessage.qml index d88bf1b147..c0f3fa1006 100644 --- a/interface/resources/qml/hifi/LetterboxMessage.qml +++ b/interface/resources/qml/hifi/LetterboxMessage.qml @@ -135,9 +135,46 @@ Item { } } } + // Left gray MouseArea MouseArea { - anchors.fill: parent - acceptedButtons: Qt.LeftButton + anchors.left: parent.left; + anchors.right: textContainer.left; + anchors.top: textContainer.top; + anchors.bottom: textContainer.bottom; + acceptedButtons: Qt.LeftButton; + onClicked: { + letterbox.visible = false; + } + } + // Right gray MouseArea + MouseArea { + anchors.left: textContainer.left; + anchors.right: parent.left; + anchors.top: textContainer.top; + anchors.bottom: textContainer.bottom; + acceptedButtons: Qt.LeftButton; + onClicked: { + letterbox.visible = false; + } + } + // Top gray MouseArea + MouseArea { + anchors.left: parent.left; + anchors.right: parent.right; + anchors.top: parent.top; + anchors.bottom: textContainer.top; + acceptedButtons: Qt.LeftButton; + onClicked: { + letterbox.visible = false; + } + } + // Bottom gray MouseArea + MouseArea { + anchors.left: parent.left; + anchors.right: parent.right; + anchors.top: textContainer.bottom; + anchors.bottom: parent.bottom; + acceptedButtons: Qt.LeftButton; onClicked: { letterbox.visible = false; } From e01e7cc7bc3a814d4b11e3c7ce42f1ab33927ffa Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Mon, 16 Apr 2018 15:25:04 -0700 Subject: [PATCH 2/2] Be a bit more efficient --- .../resources/qml/hifi/LetterboxMessage.qml | 62 ++++++------------- 1 file changed, 18 insertions(+), 44 deletions(-) diff --git a/interface/resources/qml/hifi/LetterboxMessage.qml b/interface/resources/qml/hifi/LetterboxMessage.qml index c0f3fa1006..8a18d88842 100644 --- a/interface/resources/qml/hifi/LetterboxMessage.qml +++ b/interface/resources/qml/hifi/LetterboxMessage.qml @@ -30,6 +30,16 @@ Item { color: "black" opacity: 0.5 radius: popupRadius + + MouseArea { + anchors.fill: parent; + hoverEnabled: true; + acceptedButtons: Qt.LeftButton; + propagateComposedEvents: false; + onClicked: { + letterbox.visible = false; + } + } } Rectangle { id: textContainer; @@ -38,6 +48,14 @@ Item { anchors.centerIn: parent radius: popupRadius color: "white" + + // Prevent dismissing the popup by clicking on the textContainer + MouseArea { + anchors.fill: parent; + hoverEnabled: true; + propagateComposedEvents: false; + } + Item { id: contentContainer width: parent.width - 50 @@ -135,48 +153,4 @@ Item { } } } - // Left gray MouseArea - MouseArea { - anchors.left: parent.left; - anchors.right: textContainer.left; - anchors.top: textContainer.top; - anchors.bottom: textContainer.bottom; - acceptedButtons: Qt.LeftButton; - onClicked: { - letterbox.visible = false; - } - } - // Right gray MouseArea - MouseArea { - anchors.left: textContainer.left; - anchors.right: parent.left; - anchors.top: textContainer.top; - anchors.bottom: textContainer.bottom; - acceptedButtons: Qt.LeftButton; - onClicked: { - letterbox.visible = false; - } - } - // Top gray MouseArea - MouseArea { - anchors.left: parent.left; - anchors.right: parent.right; - anchors.top: parent.top; - anchors.bottom: textContainer.top; - acceptedButtons: Qt.LeftButton; - onClicked: { - letterbox.visible = false; - } - } - // Bottom gray MouseArea - MouseArea { - anchors.left: parent.left; - anchors.right: parent.right; - anchors.top: textContainer.bottom; - anchors.bottom: parent.bottom; - acceptedButtons: Qt.LeftButton; - onClicked: { - letterbox.visible = false; - } - } }