changing opacity to 0.5

This commit is contained in:
Wayne Chen 2018-12-05 10:16:48 -08:00
parent 37beab3ab3
commit eb51a5b7b6
9 changed files with 102 additions and 111 deletions

View file

@ -36,6 +36,8 @@ FocusScope {
property string title: "" property string title: ""
property string text: "" property string text: ""
property int titleWidth: 0 property int titleWidth: 0
property alias bannerWidth: banner.width
property alias bannerHeight: banner.height
function tryDestroy() { function tryDestroy() {
root.destroy() root.destroy()
@ -50,10 +52,36 @@ FocusScope {
} }
Image { Image {
z: -10
id: loginDialogBackground id: loginDialogBackground
source: "LoginDialog/background.jpg" source: "LoginDialog/background.jpg"
anchors.fill: parent anchors.fill: parent
z: -2 }
Rectangle {
z: -6
id: opaqueRect
height: parent.height
width: parent.width
opacity: 0.5
color: "black"
}
Item {
z: -5
id: bannerContainer
width: parent.width
height: banner.height
anchors {
top: parent.top
topMargin: 0.18 * parent.height
}
Image {
id: banner
anchors.centerIn: parent
source: "../images/high-fidelity-banner.svg"
horizontalAlignment: Image.AlignHCenter
}
} }
Keys.onPressed: { Keys.onPressed: {

View file

@ -56,29 +56,6 @@ Item {
anchors.fill: parent anchors.fill: parent
onHeightChanged: d.resize(); onWidthChanged: d.resize(); onHeightChanged: d.resize(); onWidthChanged: d.resize();
Rectangle {
id: opaqueRect
height: parent.height
width: parent.width
opacity: 0.9
color: "black"
}
Item {
id: bannerContainer
width: parent.width
height: banner.height
anchors {
bottom: textContainer.top
bottomMargin: 0.125 * parent.height
}
Image {
id: banner
anchors.centerIn: parent
source: "../../images/high-fidelity-banner.svg"
horizontalAlignment: Image.AlignHCenter
}
}
Item { Item {
id: textContainer id: textContainer
width: parent.width width: parent.width

View file

@ -57,29 +57,6 @@ Item {
height: root.height height: root.height
onHeightChanged: d.resize(); onWidthChanged: d.resize(); onHeightChanged: d.resize(); onWidthChanged: d.resize();
Rectangle {
id: opaqueRect
height: parent.height
width: parent.width
opacity: 0.9
color: "black"
}
Item {
id: bannerContainer
width: parent.width
height: banner.height
anchors {
top: parent.top
topMargin: 0.18 * parent.height
}
Image {
id: banner
anchors.centerIn: parent
source: "../../images/high-fidelity-banner.svg"
horizontalAlignment: Image.AlignHCenter
}
}
Item { Item {
id: contentItem id: contentItem
anchors.fill: parent anchors.fill: parent
@ -105,13 +82,13 @@ Item {
Item { Item {
id: buttons id: buttons
width: banner.width width: root.bannerWidth
height: d.minHeightButton height: d.minHeightButton
anchors { anchors {
top: parent.top top: parent.top
topMargin: (parent.height - additionalTextContainer.height) / 2 - hifi.dimensions.contentSpacing.y topMargin: (parent.height - additionalTextContainer.height) / 2 - hifi.dimensions.contentSpacing.y
left: parent.left left: parent.left
leftMargin: (parent.width - banner.width) / 2 leftMargin: (parent.width - root.bannerWidth) / 2
} }
HifiControlsUit.Button { HifiControlsUit.Button {
id: cancelButton id: cancelButton

View file

@ -96,36 +96,13 @@ Item {
height: root.height height: root.height
onHeightChanged: d.resize(); onWidthChanged: d.resize(); onHeightChanged: d.resize(); onWidthChanged: d.resize();
Rectangle {
id: opaqueRect
height: parent.height
width: parent.width
opacity: 0.9
color: "black"
}
Item {
id: bannerContainer
width: parent.width
height: banner.height
anchors {
bottom: loginContainer.top
bottomMargin: 0.07 * parent.height
}
Image {
id: banner
anchors.centerIn: parent
source: "../../images/high-fidelity-banner.svg"
horizontalAlignment: Image.AlignHCenter
}
}
Item { Item {
id: loginContainer id: loginContainer
width: emailField.width width: emailField.width
height: 0.45 * parent.height height: 0.45 * parent.height
anchors { anchors {
top: parent.top top: parent.top
topMargin: bannerContainer.height + 0.25 * parent.height topMargin: root.bannerHeight + 0.25 * parent.height
left: parent.left left: parent.left
leftMargin: (parent.width - emailField.width) / 2 leftMargin: (parent.width - emailField.width) / 2
} }
@ -157,7 +134,7 @@ Item {
HifiControlsUit.TextField { HifiControlsUit.TextField {
id: emailField id: emailField
width: banner.width width: root.bannerWidth
height: linkAccountBody.textFieldHeight height: linkAccountBody.textFieldHeight
font.pixelSize: linkAccountBody.textFieldFontSize font.pixelSize: linkAccountBody.textFieldFontSize
styleRenderType: Text.QtRendering styleRenderType: Text.QtRendering
@ -194,7 +171,7 @@ Item {
} }
HifiControlsUit.TextField { HifiControlsUit.TextField {
id: passwordField id: passwordField
width: banner.width width: root.bannerWidth
height: linkAccountBody.textFieldHeight height: linkAccountBody.textFieldHeight
font.pixelSize: linkAccountBody.textFieldFontSize font.pixelSize: linkAccountBody.textFieldFontSize
styleRenderType: Text.QtRendering styleRenderType: Text.QtRendering

View file

@ -123,7 +123,7 @@ Item {
id: opaqueRect id: opaqueRect
height: parent.height height: parent.height
width: parent.width width: parent.width
opacity: 0.9 opacity: 0.7
color: "black" color: "black"
} }

View file

@ -122,10 +122,10 @@ Item {
Item { Item {
id: loginContainer id: loginContainer
width: usernameField.width width: usernameField.width
height: parent.height - bannerContainer.height height: parent.height
anchors { anchors {
top: parent.top top: parent.top
topMargin: bannerContainer.height + 0.25 * parent.height topMargin: root.bannerHeight + 0.25 * parent.height
left: parent.left left: parent.left
leftMargin: (parent.width - usernameField.width) / 2 leftMargin: (parent.width - usernameField.width) / 2
} }
@ -159,7 +159,7 @@ Item {
HifiControlsUit.TextField { HifiControlsUit.TextField {
id: usernameField id: usernameField
width: banner.width width: root.bannerWidth
height: signUpBody.textFieldHeight height: signUpBody.textFieldHeight
placeholderText: "Username" placeholderText: "Username"
font.pixelSize: signUpBody.textFieldFontSize font.pixelSize: signUpBody.textFieldFontSize
@ -204,7 +204,7 @@ Item {
HifiControlsUit.TextField { HifiControlsUit.TextField {
id: emailField id: emailField
width: banner.width width: root.bannerWidth
height: signUpBody.textFieldHeight height: signUpBody.textFieldHeight
anchors { anchors {
top: parent.top top: parent.top
@ -246,7 +246,7 @@ Item {
} }
HifiControlsUit.TextField { HifiControlsUit.TextField {
id: passwordField id: passwordField
width: banner.width width: root.bannerWidth
height: signUpBody.textFieldHeight height: signUpBody.textFieldHeight
placeholderText: "Password" placeholderText: "Password"
font.pixelSize: signUpBody.textFieldFontSize font.pixelSize: signUpBody.textFieldFontSize

View file

@ -66,30 +66,6 @@ Item {
onHeightChanged: d.resize(); onWidthChanged: d.resize(); onHeightChanged: d.resize(); onWidthChanged: d.resize();
anchors.fill: parent anchors.fill: parent
Rectangle {
id: opaqueRect
height: parent.height
width: parent.width
opacity: 0.9
color: "black"
}
Item {
id: bannerContainer
width: parent.width
height: banner.height
anchors {
top: parent.top
topMargin: 0.18 * parent.height
}
Image {
id: banner
anchors.centerIn: parent
source: "../../images/high-fidelity-banner.svg"
horizontalAlignment: Image.AlignHCenter
}
}
TextMetrics { TextMetrics {
id: mainTextContainerTextMetrics id: mainTextContainerTextMetrics
font: mainTextContainer.font font: mainTextContainer.font
@ -129,7 +105,7 @@ Item {
font.pixelSize: usernameCollisionBody.fontSize font.pixelSize: usernameCollisionBody.fontSize
styleRenderType: Text.QtRendering styleRenderType: Text.QtRendering
font.bold: usernameCollisionBody.fontBold font.bold: usernameCollisionBody.fontBold
width: banner.width width: root.bannerWidth
placeholderText: "Choose your own" placeholderText: "Choose your own"
@ -167,13 +143,13 @@ Item {
Item { Item {
id: buttons id: buttons
width: banner.width width: root.bannerWidth
height: d.minHeightButton height: d.minHeightButton
anchors { anchors {
top: textField.bottom top: textField.bottom
topMargin: hifi.dimensions.contentSpacing.y topMargin: hifi.dimensions.contentSpacing.y
left: parent.left left: parent.left
leftMargin: (parent.width - banner.width) / 2 leftMargin: (parent.width - root.bannerWidth) / 2
} }
HifiControlsUit.Button { HifiControlsUit.Button {

View file

@ -36,6 +36,8 @@ FocusScope {
property string title: "" property string title: ""
property int titleWidth: 0 property int titleWidth: 0
property alias text: loginKeyboard.mirroredText property alias text: loginKeyboard.mirroredText
property alias bannerWidth: banner.width
property alias bannerHeight: banner.height
function tryDestroy() { function tryDestroy() {
root.destroy() root.destroy()
@ -51,10 +53,36 @@ FocusScope {
} }
Image { Image {
z: -10
id: loginDialogBackground id: loginDialogBackground
source: "LoginDialog/background.jpg" source: "LoginDialog/background.jpg"
anchors.fill: parent anchors.fill: parent
z: -2 }
Rectangle {
z: -6
id: opaqueRect
height: parent.height
width: parent.width
opacity: 0.5
color: "black"
}
Item {
z: -5
id: bannerContainer
width: parent.width
height: banner.height
anchors {
top: parent.top
topMargin: 0.18 * parent.height
}
Image {
id: banner
anchors.centerIn: parent
source: "../images/high-fidelity-banner.svg"
horizontalAlignment: Image.AlignHCenter
}
} }
Timer { Timer {

View file

@ -39,6 +39,8 @@ FocusScope {
property alias text: loginKeyboard.mirroredText property alias text: loginKeyboard.mirroredText
property int titleWidth: 0 property int titleWidth: 0
property alias bannerWidth: banner.width
property alias bannerHeight: banner.height
property string iconText: hifi.glyphs.avatar property string iconText: hifi.glyphs.avatar
property int iconSize: 35 property int iconSize: 35
@ -90,10 +92,36 @@ FocusScope {
} }
Image { Image {
z: -10
id: loginDialogBackground id: loginDialogBackground
source: "../LoginDialog/background_tablet.jpg" source: "../LoginDialog/background_tablet.jpg"
anchors.fill: parent anchors.fill: parent
z: -2 }
Item {
z: -5
id: bannerContainer
width: parent.width
height: banner.height
anchors {
top: parent.top
topMargin: 0.18 * parent.height
}
Image {
id: banner
anchors.centerIn: parent
source: "../../images/high-fidelity-banner.svg"
horizontalAlignment: Image.AlignHCenter
}
}
Rectangle {
z: -6
id: opaqueRect
height: parent.height
width: parent.width
opacity: 0.5
color: "black"
} }
HifiControlsUit.Keyboard { HifiControlsUit.Keyboard {