From d1d1830b2f811ae181b7055a82bab7878ef85afb Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Tue, 28 Apr 2015 00:26:24 -0700 Subject: [PATCH] Importing peferred dialog look from browser branch --- interface/resources/qml/controls/Dialog.qml | 12 +++++++ .../resources/qml/controls/DialogBase.qml | 32 ++++++++++++++++--- .../resources/qml/controls/TextInput.qml | 4 +-- 3 files changed, 41 insertions(+), 7 deletions(-) diff --git a/interface/resources/qml/controls/Dialog.qml b/interface/resources/qml/controls/Dialog.qml index 629813d3b5..46add1dc07 100644 --- a/interface/resources/qml/controls/Dialog.qml +++ b/interface/resources/qml/controls/Dialog.qml @@ -92,6 +92,7 @@ DialogBase { anchors.bottom: parent.bottom width: 16 height: 16 + z: 1000 hoverEnabled: true onPressed: { startX = mouseX @@ -143,4 +144,15 @@ DialogBase { } } } + + Keys.onPressed: { + switch(event.key) { + case Qt.Key_W: + if (event.modifiers == Qt.ControlModifier) { + event.accepted = true + enabled = false + } + break; + } + } } diff --git a/interface/resources/qml/controls/DialogBase.qml b/interface/resources/qml/controls/DialogBase.qml index 050237c184..a6616fc731 100644 --- a/interface/resources/qml/controls/DialogBase.qml +++ b/interface/resources/qml/controls/DialogBase.qml @@ -22,11 +22,13 @@ Item { readonly property alias titleWidth: titleBorder.width readonly property alias titleHeight: titleBorder.height + // readonly property real borderWidth: hifi.styles.borderWidth + readonly property real borderWidth: 0 property alias clientBorder: clientBorder - readonly property real clientX: clientBorder.x + hifi.styles.borderWidth - readonly property real clientY: clientBorder.y + hifi.styles.borderWidth - readonly property real clientWidth: clientBorder.width - hifi.styles.borderWidth * 2 - readonly property real clientHeight: clientBorder.height - hifi.styles.borderWidth * 2 + readonly property real clientX: clientBorder.x + borderWidth + readonly property real clientY: clientBorder.y + borderWidth + readonly property real clientWidth: clientBorder.width - borderWidth * 2 + readonly property real clientHeight: clientBorder.height - borderWidth * 2 /* * Window decorations, with a title bar and frames @@ -35,6 +37,7 @@ Item { id: windowBorder anchors.fill: parent border.color: root.frameColor + border.width: 0 color: "#00000000" Border { @@ -43,11 +46,13 @@ Item { anchors.right: parent.right anchors.left: parent.left border.color: root.frameColor + border.width: 0 clip: true color: root.active ? hifi.colors.activeWindow.headerBackground : hifi.colors.inactiveWindow.headerBackground + Text { id: titleText color: root.active ? @@ -60,8 +65,26 @@ Item { } } // header border + // These two rectangles hide the curves between the title area + // and the client area + Rectangle { + y: titleBorder.height - titleBorder.radius + height: titleBorder.radius + width: titleBorder.width + color: titleBorder.color + visible: borderWidth == 0 + } + + Rectangle { + y: titleBorder.height + width: clientBorder.width + height: clientBorder.radius + color: clientBorder.color + } + Border { id: clientBorder + border.width: 0 border.color: root.frameColor color: root.backgroundColor anchors.bottom: parent.bottom @@ -69,7 +92,6 @@ Item { anchors.topMargin: -titleBorder.border.width anchors.right: parent.right anchors.left: parent.left - clip: true } // client border } // window border diff --git a/interface/resources/qml/controls/TextInput.qml b/interface/resources/qml/controls/TextInput.qml index ceaca0c073..d533c67bd6 100644 --- a/interface/resources/qml/controls/TextInput.qml +++ b/interface/resources/qml/controls/TextInput.qml @@ -13,14 +13,14 @@ Original.TextInput { font.family: hifi.fonts.fontFamily font.pointSize: hifi.fonts.fontSize - +/* Original.Rectangle { // Render the rectangle as background z: -1 anchors.fill: parent color: hifi.colors.inputBackground } - +*/ Text { anchors.fill: parent font.pointSize: parent.font.pointSize