mirror of
https://github.com/overte-org/overte.git
synced 2025-04-16 00:41:16 +02:00
Grow width of QML message box to accommodate wide title if necessary
This commit is contained in:
parent
830f53cc46
commit
f75aa97728
2 changed files with 6 additions and 1 deletions
|
@ -51,6 +51,9 @@ ModalWindow {
|
|||
property int clickedButton: OriginalDialogs.StandardButton.NoButton;
|
||||
focus: defaultButton === OriginalDialogs.StandardButton.NoButton
|
||||
|
||||
property int titleWidth: 0
|
||||
onTitleWidthChanged: d.resize();
|
||||
|
||||
function updateIcon() {
|
||||
if (!root) {
|
||||
return;
|
||||
|
@ -72,7 +75,7 @@ ModalWindow {
|
|||
readonly property int maxHeight: 720
|
||||
|
||||
function resize() {
|
||||
var targetWidth = mainTextContainer.width
|
||||
var targetWidth = Math.max(titleWidth, mainTextContainer.width)
|
||||
var targetHeight = mainTextContainer.height + 3 * hifi.dimensions.contentSpacing.y
|
||||
+ (informativeTextContainer.text != "" ? informativeTextContainer.contentHeight + 3 * hifi.dimensions.contentSpacing.y : 0)
|
||||
+ buttons.height
|
||||
|
|
|
@ -50,6 +50,8 @@ Frame {
|
|||
width: title.width + (icon.text !== "" ? icon.width + hifi.dimensions.contentSpacing.x : 0)
|
||||
x: (parent.width - width) / 2
|
||||
|
||||
onWidthChanged: window.titleWidth = width
|
||||
|
||||
HiFiGlyphs {
|
||||
id: icon
|
||||
text: window.iconText ? window.iconText : ""
|
||||
|
|
Loading…
Reference in a new issue