Checkpoint

This commit is contained in:
Zach Fox 2017-01-17 17:39:13 -08:00
parent 202d4e8107
commit 9d19aa3c79
3 changed files with 65 additions and 57 deletions

View file

@ -19,6 +19,7 @@ Item {
property alias headerText: headerText.text property alias headerText: headerText.text
property real popupRadius: hifi.dimensions.borderRadius property real popupRadius: hifi.dimensions.borderRadius
property real headerTextPixelSize: 22 property real headerTextPixelSize: 22
property real popupTextPixelSize: 16
FontLoader { id: ralewayRegular; source: "../../fonts/Raleway-Regular.ttf"; } FontLoader { id: ralewayRegular; source: "../../fonts/Raleway-Regular.ttf"; }
FontLoader { id: ralewaySemiBold; source: "../../fonts/Raleway-SemiBold.ttf"; } FontLoader { id: ralewaySemiBold; source: "../../fonts/Raleway-SemiBold.ttf"; }
visible: false visible: false
@ -32,68 +33,70 @@ Item {
} }
Rectangle { Rectangle {
width: Math.max(parent.width * 0.75, 400) width: Math.max(parent.width * 0.75, 400)
height: contentContainer.height*1.5 height: childrenRect.height + 50
anchors.centerIn: parent anchors.centerIn: parent
radius: popupRadius radius: popupRadius
color: "white" color: "white"
Item { Column {
id: contentContainer id: contentContainer
width: parent.width - 60
anchors.centerIn: parent anchors.centerIn: parent
anchors.margins: 20 spacing: 20
height: childrenRect.height Row {
Item {
id: popupHeaderContainer id: popupHeaderContainer
visible: headerText.text !== "" || glyphText.text !== "" visible: headerText.text !== "" || headerGlyph.text !== ""
// Size height: 30
width: parent.width Column {
height: childrenRect.height
// Anchors
anchors.top: parent.top
anchors.left: parent.left
// Header Glyph // Header Glyph
HiFiGlyphs { HiFiGlyphs {
id: headerGlyph id: headerGlyph
visible: headerText.text !== "" visible: headerGlyph.text !== ""
// Size
height: parent.parent.height
// Anchors
anchors.left: parent.left
anchors.leftMargin: -15
// Text Size // Text Size
size: headerTextPixelSize*2.5 size: headerTextPixelSize*2.5
// Anchors
anchors.top: parent.top
anchors.left: parent.left
anchors.rightMargin: 5
// Style // Style
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHLeft
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
color: hifi.colors.darkGray color: hifi.colors.darkGray
} }
}
Column {
// Header Text
Text { Text {
id: headerText id: headerText
visible: headerGlyph.text !== "" visible: headerText.text !== ""
// Size
height: parent.parent.height
// Anchors
anchors.left: parent.left
anchors.leftMargin: -15
// Text Size // Text Size
font.pixelSize: headerTextPixelSize font.pixelSize: headerTextPixelSize
// Anchors
anchors.top: parent.top
anchors.left: headerGlyph.right
// Style // Style
font.family: ralewaySemiBold.name font.family: ralewaySemiBold.name
color: hifi.colors.darkGray color: hifi.colors.darkGray
horizontalAlignment: Text.AlignHLeft
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
textFormat: Text.StyledText textFormat: Text.StyledText
} }
} }
}
Row {
// Popup Text
Text { Text {
id: popupText id: popupText
// Anchors // Size
anchors.top: popupHeaderContainer.visible ? popupHeaderContainer.anchors.bottom : parent.top width: parent.parent.width
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
// Text alignment // Text alignment
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHLeft
// Style // Style
font.pixelSize: hifi.fontSizes.textFieldInput font.pixelSize: popupTextPixelSize
font.family: ralewayRegular.name font.family: ralewayRegular.name
color: hifi.colors.darkGray color: hifi.colors.darkGray
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
@ -101,6 +104,7 @@ Item {
} }
} }
} }
}
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
acceptedButtons: Qt.LeftButton acceptedButtons: Qt.LeftButton

View file

@ -220,7 +220,9 @@ Item {
anchors.fill: parent anchors.fill: parent
acceptedButtons: Qt.LeftButton acceptedButtons: Qt.LeftButton
hoverEnabled: true hoverEnabled: true
onClicked: letterbox("This user is an admin on this domain. Admins can <b>Silence</b> and <b>Ban</b> other users at their discretion - so be extra nice!", hifi.glyphs.question, "Domain Admin") onClicked: letterbox("This user is an admin on this domain. Admins can <b>Silence</b> and <b>Ban</b> other users at their discretion - so be extra nice!",
hifi.glyphs.question,
"Domain Admin")
onEntered: adminLabelQuestionMarkText.color = "#94132e" onEntered: adminLabelQuestionMarkText.color = "#94132e"
onExited: adminLabelQuestionMarkText.color = hifi.colors.redHighlight onExited: adminLabelQuestionMarkText.color = hifi.colors.redHighlight
} }

View file

@ -403,8 +403,10 @@ Rectangle {
anchors.fill: parent anchors.fill: parent
acceptedButtons: Qt.LeftButton acceptedButtons: Qt.LeftButton
hoverEnabled: true hoverEnabled: true
onClicked: letterbox('Silencing a user mutes their microphone. Silenced users can unmute themselves by clicking the "UNMUTE" button on their HUD.\n\n' + onClicked: letterbox("<b>Silence</b> mutes a user's microphone. Silenced users can unmute themselves by clicking &quot;UNMUTE&quot; on their toolbar.<br><br>" +
"Banning a user will remove them from this domain and prevent them from returning. You can un-ban users from your domain's settings page.)", "", "") "<b>Ban</b> removes a user from this domain and prevents them from returning. Admins can un-ban users from the Sandbox Domain Settings Page.)",
hifi.glyphs.question,
"Admin Actions")
onEntered: adminHelpText.color = "#94132e" onEntered: adminHelpText.color = "#94132e"
onExited: adminHelpText.color = hifi.colors.redHighlight onExited: adminHelpText.color = hifi.colors.redHighlight
} }