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