mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
Finesse modal message box dialog layout
This commit is contained in:
parent
7ee1edac3a
commit
a816d835d3
3 changed files with 13 additions and 13 deletions
|
@ -89,8 +89,8 @@ ModalWindow {
|
|||
|
||||
function resize() {
|
||||
var targetWidth = mainTextContainer.width
|
||||
var targetHeight = mainTextContainer.height + 4 * hifi.dimensions.contentSpacing.y
|
||||
+ (informativeTextContainer.text != "" ? informativeTextContainer.contentHeight + hifi.dimensions.contentSpacing.y : 0)
|
||||
var targetHeight = mainTextContainer.height + 3 * hifi.dimensions.contentSpacing.y
|
||||
+ (informativeTextContainer.text != "" ? informativeTextContainer.contentHeight + 3 * hifi.dimensions.contentSpacing.y : 0)
|
||||
+ buttons.height
|
||||
+ (content.state === "expanded" ? details.implicitHeight + hifi.dimensions.contentSpacing.y : 0)
|
||||
root.width = (targetWidth < d.minWidth) ? d.minWidth : ((targetWidth > d.maxWdith) ? d.maxWidth : targetWidth)
|
||||
|
@ -121,9 +121,9 @@ ModalWindow {
|
|||
size: hifi.fontSizes.menuItem
|
||||
color: hifi.colors.baseGrayHighlight
|
||||
anchors {
|
||||
top: mainTextContainer.bottom;
|
||||
left: parent.left;
|
||||
right: parent.right;
|
||||
top: mainTextContainer.bottom
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
margins: 0
|
||||
topMargin: text != "" ? hifi.dimensions.contentSpacing.y : 0
|
||||
}
|
||||
|
@ -136,10 +136,10 @@ ModalWindow {
|
|||
onHeightChanged: d.resize(); onWidthChanged: d.resize();
|
||||
layoutDirection: Qt.RightToLeft
|
||||
anchors {
|
||||
top: informativeTextContainer.bottom
|
||||
top: informativeTextContainer.text == "" ? mainTextContainer.bottom : informativeTextContainer.bottom
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
margins: 0
|
||||
topMargin: hifi.dimensions.contentSpacing.y
|
||||
topMargin: 2 * hifi.dimensions.contentSpacing.y
|
||||
}
|
||||
MessageDialogButton { dialog: root; text: qsTr("Close"); button: OriginalDialogs.StandardButton.Close; }
|
||||
MessageDialogButton { dialog: root; text: qsTr("Abort"); button: OriginalDialogs.StandardButton.Abort; }
|
||||
|
|
|
@ -79,7 +79,7 @@ Item {
|
|||
readonly property real textPadding: 8
|
||||
readonly property real tablePadding: 12
|
||||
readonly property real tableRowHeight: largeScreen ? 26 : 23
|
||||
readonly property real modalDialogMargin: 50
|
||||
readonly property vector2d modalDialogMargin: Qt.vector2d(50, 30)
|
||||
readonly property real modalDialogTitleHeight: 40
|
||||
}
|
||||
|
||||
|
|
|
@ -25,10 +25,10 @@ Frame {
|
|||
|
||||
Rectangle {
|
||||
anchors {
|
||||
topMargin: -hifi.dimensions.modalDialogMargin - (modalFrame.hasTitle ? hifi.dimensions.modalDialogTitleHeight : 0)
|
||||
leftMargin: -hifi.dimensions.modalDialogMargin
|
||||
rightMargin: -hifi.dimensions.modalDialogMargin
|
||||
bottomMargin: -hifi.dimensions.modalDialogMargin
|
||||
topMargin: -hifi.dimensions.modalDialogMargin.y - (modalFrame.hasTitle ? hifi.dimensions.modalDialogTitleHeight + 10 : 0)
|
||||
leftMargin: -hifi.dimensions.modalDialogMargin.x
|
||||
rightMargin: -hifi.dimensions.modalDialogMargin.x
|
||||
bottomMargin: -hifi.dimensions.modalDialogMargin.y
|
||||
fill: parent
|
||||
}
|
||||
border {
|
||||
|
@ -50,7 +50,7 @@ Frame {
|
|||
size: 30
|
||||
color: hifi.colors.lightGrayText
|
||||
visible: text != ""
|
||||
y: -hifi.dimensions.modalDialogTitleHeight - 3
|
||||
y: -hifi.dimensions.modalDialogTitleHeight - 5
|
||||
anchors.left: parent.left
|
||||
}
|
||||
RalewayRegular {
|
||||
|
|
Loading…
Reference in a new issue