improved layout to match the figment more

This commit is contained in:
milad 2019-07-25 12:08:40 -07:00
parent 993e5db2da
commit 4c0d8b6fda

View file

@ -1,12 +1,13 @@
import QtQuick 2.5 import QtQuick 2.5
import QtWebEngine 1.5 import QtWebEngine 1.5
import QtQuick.Layouts 1.3
import controlsUit 1.0 as HifiControls import controlsUit 1.0 as HifiControls
import stylesUit 1.0 as HifiStyles import stylesUit 1.0 as HifiStyles
Rectangle { Rectangle {
id: root id: root
width: 600 width: 750
height: 200 height: 225
color: hifi.colors.white color: hifi.colors.white
anchors.centerIn: parent anchors.centerIn: parent
@ -22,78 +23,79 @@ Rectangle {
property string currentRequestedPermission property string currentRequestedPermission
signal permissionButtonPressed(int buttonNumber) signal permissionButtonPressed(int buttonNumber)
Row { ColumnLayout {
anchors.fill: parent
Rectangle {
id: webAccessHeaderContainer id: webAccessHeaderContainer
height: 75
anchors.top: parent.top
Layout.preferredWidth: parent.width
height: 60
width: parent.width
HifiStyles.RalewayBold { HifiStyles.RalewayBold {
id: webAccessHeaderText id: webAccessHeaderText
text: "REQUEST FOR DEVICE ACCESS" text: "REQUEST FOR DEVICE ACCESS"
anchors.centerIn: parent
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
wrapMode: Text.WordWrap
color: hifi.colors.black color: hifi.colors.black
size: 17 size: 30
} }
} }
Row { Rectangle {
id: webAccessInfoContainer id: webAccessInfoContainer
height: 60 height: 35
width: parent.width Layout.preferredWidth: parent.width
anchors.top: webAccessHeaderContainer.bottom
HifiStyles.RalewayLight { HifiStyles.RalewayLight {
id: webAccessInfoText id: webAccessInfoText
wrapMode: Text.WordWrap
width: root.width
horizontalAlignment: Text.AlignHCenter
text: "This website is attempting to " + root.permissionLanguage[root.currentRequestedPermission] + "." text: "This website is attempting to " + root.permissionLanguage[root.currentRequestedPermission] + "."
size: 15
anchors.centerIn: parent
wrapMode: Text.WordWrap
size: 20
color: hifi.colors.black color: hifi.colors.black
} }
} }
Row {
id: permissionsButtonsRow
height: 100
width: parent.width
anchors.top: webAccessInfoContainer.bottom
Rectangle { Rectangle {
id: permissionsButtonsContainer id: permissionsButtonsRow
height: 50 height: 115
width: parent.width Layout.preferredWidth: parent.width
anchors.fill: parent Layout.topMargin: 35
property int space: 8
property int space: 5 readonly property int _LEFT_BUTTON: 0
readonly property int _RIGHT_BUTTON: 1
HifiControls.Button { HifiControls.Button {
id: leftButton id: leftButton
text: "Don't Allow"
anchors.right: parent.horizontalCenter anchors.right: parent.horizontalCenter
anchors.horizontalCenterOffset: -parent.space anchors.rightMargin: parent.space
text: "Don't Allow"
color: hifi.buttons.red color: hifi.buttons.red
enabled: true enabled: true
height: 25 height: 38
onClicked: { onClicked: {
root.permissionButtonPressed(0); root.permissionButtonPressed(parent._LEFT_BUTTON);
} }
} }
HifiControls.Button { HifiControls.Button {
id: rightButton id: rightButton
text: "Yes allow access"
anchors.left: parent.horizontalCenter anchors.left: parent.horizontalCenter
anchors.horizontalCenterOffset: parent.space anchors.leftMargin: parent.space
text: "Yes allow access"
color: hifi.buttons.blue color: hifi.buttons.blue
enabled: true enabled: true
width: 155 width: 155
height: 25 height: 38
onClicked: { onClicked: {
root.permissionButtonPressed(1); root.permissionButtonPressed(parent._RIGHT_BUTTON);
} }
} }
} }
} }
} }