25% opacity from PM req/fixing error message in profile body

This commit is contained in:
Wayne Chen 2018-12-05 19:42:44 -08:00
parent a3a575acd1
commit f8a55a9196
5 changed files with 40 additions and 21 deletions

View file

@ -63,7 +63,7 @@ FocusScope {
id: opaqueRect id: opaqueRect
height: parent.height height: parent.height
width: parent.width width: parent.width
opacity: 0.5 opacity: 0.25
color: "black" color: "black"
} }

View file

@ -61,23 +61,39 @@ Item {
id: contentItem id: contentItem
anchors.fill: parent anchors.fill: parent
TextMetrics { Item {
id: loginErrorMessageTextMetrics id: errorContainer
font: loginErrorMessage.font width: parent.width
text: loginErrorMessage.text height: loginErrorMessageTextMetrics.height
} anchors {
Text { bottom: buttons.top;
id: loginErrorMessage bottomMargin: hifi.dimensions.contentSpacing.y;
anchors.top: parent.top; left: buttons.left;
// above buttons. }
anchors.topMargin: (parent.height - additionalTextContainer.height) / 2 - hifi.dimensions.contentSpacing.y - profileButton.height TextMetrics {
anchors.left: parent.left; id: loginErrorMessageTextMetrics
anchors.leftMargin: (parent.width - loginErrorMessageTextMetrics.width) / 2; font: loginErrorMessage.font
color: "red"; text: loginErrorMessage.text
font.family: completeProfileBody.fontFamily }
font.pixelSize: completeProfileBody.fontSize Text {
text: completeProfileBody.errorString id: loginErrorMessage;
visible: true width: root.bannerWidth
color: "red";
font.family: signUpBody.fontFamily
font.pixelSize: 18
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
text: completeProfileBody.errorString
visible: true
}
Component.onCompleted: {
if (loginErrorMessageTextMetrics.width > 350 && root.isTablet) {
loginErrorMessage.wrapMode = Text.WordWrap;
loginErrorMessage.verticalAlignment = Text.AlignLeft;
loginErrorMessage.horizontalAlignment = Text.AlignLeft;
errorContainer.height = 2 * loginErrorMessageTextMetrics.height;
}
}
} }
Item { Item {

View file

@ -474,7 +474,7 @@ Item {
onFocusEnabled: { onFocusEnabled: {
Qt.callLater(function() { Qt.callLater(function() {
emailField.forceActiveFocus(); emailField.forceActiveFocus();
}) });
} }
} }
@ -485,6 +485,9 @@ Item {
root.text = ""; root.text = "";
d.resize(); d.resize();
init(); init();
Qt.callLater(function() {
emailField.forceActiveFocus();
});
} }
Keys.onPressed: { Keys.onPressed: {

View file

@ -64,7 +64,7 @@ FocusScope {
id: opaqueRect id: opaqueRect
height: parent.height height: parent.height
width: parent.width width: parent.width
opacity: 0.5 opacity: 0.25
color: "black" color: "black"
} }

View file

@ -120,7 +120,7 @@ FocusScope {
id: opaqueRect id: opaqueRect
height: parent.height height: parent.height
width: parent.width width: parent.width
opacity: 0.5 opacity: 0.25
color: "black" color: "black"
} }