From 51b41da4885ab401ab757fffe83182b7da4d6e1f Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 25 Feb 2016 09:15:07 +1300 Subject: [PATCH 1/2] Horizontally center short messages in the dialog --- interface/resources/qml/dialogs/MessageDialog.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/resources/qml/dialogs/MessageDialog.qml b/interface/resources/qml/dialogs/MessageDialog.qml index 21d17c4e54..26ed406b02 100644 --- a/interface/resources/qml/dialogs/MessageDialog.qml +++ b/interface/resources/qml/dialogs/MessageDialog.qml @@ -105,8 +105,8 @@ ModalWindow { size: hifi.fontSizes.menuItem color: hifi.colors.baseGrayHighlight anchors { - top: parent.top; - left: parent.left; + top: parent.top + horizontalCenter: parent.horizontalCenter margins: 0 topMargin: hifi.dimensions.contentSpacing.y } From b9a1c2051b5934246d80f04a87298ac7d92353f8 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 25 Feb 2016 10:52:16 +1300 Subject: [PATCH 2/2] Fix modal dialog not being opaque to mouse clicks --- .../resources/qml/windows-uit/ModalFrame.qml | 92 ++++++++++--------- .../resources/qml/windows-uit/Window.qml | 4 +- 2 files changed, 51 insertions(+), 45 deletions(-) diff --git a/interface/resources/qml/windows-uit/ModalFrame.qml b/interface/resources/qml/windows-uit/ModalFrame.qml index 17b60061e8..d6c05c8f91 100644 --- a/interface/resources/qml/windows-uit/ModalFrame.qml +++ b/interface/resources/qml/windows-uit/ModalFrame.qml @@ -15,61 +15,67 @@ import "../controls-uit" import "../styles-uit" Frame { - Item { - id: modalFrame + HifiConstants { id: hifi } - anchors.fill: parent - anchors.margins: 0 + Rectangle { + id: modalFrame readonly property bool hasTitle: window.title != "" - Rectangle { - anchors { - topMargin: -hifi.dimensions.modalDialogMargin.y - (modalFrame.hasTitle ? hifi.dimensions.modalDialogTitleHeight + 10 : 0) - leftMargin: -hifi.dimensions.modalDialogMargin.x - rightMargin: -hifi.dimensions.modalDialogMargin.x - bottomMargin: -hifi.dimensions.modalDialogMargin.y - fill: parent - } - border { - width: hifi.dimensions.borderWidth - color: hifi.colors.lightGrayText80 - } - radius: hifi.dimensions.borderRadius - color: hifi.colors.faintGray + anchors { + fill: parent + topMargin: -hifi.dimensions.modalDialogMargin.y - (modalFrame.hasTitle ? hifi.dimensions.modalDialogTitleHeight + 10 : 0) + leftMargin: -hifi.dimensions.modalDialogMargin.x + rightMargin: -hifi.dimensions.modalDialogMargin.x + bottomMargin: -hifi.dimensions.modalDialogMargin.y } + border { + width: hifi.dimensions.borderWidth + color: hifi.colors.lightGrayText80 + } + radius: hifi.dimensions.borderRadius + color: hifi.colors.faintGray + Item { visible: modalFrame.hasTitle - width: title.width + (window.iconText !== "" ? icon.width + hifi.dimensions.contentSpacing.x : 0) - x: (parent.width - width) / 2 + anchors.fill: parent + anchors { + topMargin: -parent.anchors.topMargin + leftMargin: -parent.anchors.leftMargin + rightMargin: -parent.anchors.rightMargin + } - FontAwesome { - id: icon - text: window.iconText - size: 30 - color: hifi.colors.lightGrayText - visible: text != "" - y: -hifi.dimensions.modalDialogTitleHeight - 5 + Item { + width: title.width + (window.iconText !== "" ? icon.width + hifi.dimensions.contentSpacing.x : 0) + x: (parent.width - width) / 2 + + FontAwesome { + id: icon + text: window.iconText + size: 30 + color: hifi.colors.lightGrayText + visible: text != "" + y: -hifi.dimensions.modalDialogTitleHeight - 5 + anchors.left: parent.left + } + RalewayRegular { + id: title + text: window.title + elide: Text.ElideRight + color: hifi.colors.baseGrayHighlight + size: hifi.fontSizes.overlayTitle + y: -hifi.dimensions.modalDialogTitleHeight + anchors.right: parent.right + } + } + + Rectangle { anchors.left: parent.left - } - RalewayRegular { - id: title - text: window.title - elide: Text.ElideRight - color: hifi.colors.baseGrayHighlight - size: hifi.fontSizes.overlayTitle - y: -hifi.dimensions.modalDialogTitleHeight anchors.right: parent.right + height: 1 + color: hifi.colors.lightGray } } - - Rectangle { - anchors.left: parent.left - anchors.right: parent.right - height: 1 - color: hifi.colors.lightGray - visible: modalFrame.hasTitle - } } } diff --git a/interface/resources/qml/windows-uit/Window.qml b/interface/resources/qml/windows-uit/Window.qml index 2bc0175bf2..ae73a53d65 100644 --- a/interface/resources/qml/windows-uit/Window.qml +++ b/interface/resources/qml/windows-uit/Window.qml @@ -88,7 +88,7 @@ Fadable { property var activator: MouseArea { width: frame.decoration.width height: frame.decoration.height - x: frame.decoration.anchors.margins + x: frame.decoration.anchors.leftMargin y: frame.decoration.anchors.topMargin propagateComposedEvents: true acceptedButtons: Qt.AllButtons @@ -106,7 +106,7 @@ Fadable { property var swallower: MouseArea { width: frame.decoration.width height: frame.decoration.height - x: frame.decoration.anchors.margins + x: frame.decoration.anchors.leftMargin y: frame.decoration.anchors.topMargin hoverEnabled: true acceptedButtons: Qt.AllButtons