Importing peferred dialog look from browser branch

This commit is contained in:
Brad Davis 2015-04-28 00:26:24 -07:00
parent b0eccc40c2
commit d1d1830b2f
3 changed files with 41 additions and 7 deletions

View file

@ -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;
}
}
}

View file

@ -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

View file

@ -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