fix layouting of dialogs of both formfactors
This commit is contained in:
parent
41dadc7729
commit
18aadf9e24
|
@ -134,8 +134,7 @@ Item {
|
||||||
Item {
|
Item {
|
||||||
id: contentItem
|
id: contentItem
|
||||||
|
|
||||||
onChildrenRectChanged: mainItem.width = childrenRect.width
|
onChildrenRectChanged: mainItem.width = Math.max(childrenRect.width, buttonItem.childrenRect.width)
|
||||||
clip: true
|
|
||||||
anchors {
|
anchors {
|
||||||
top: titleBar.bottom
|
top: titleBar.bottom
|
||||||
left: parent.left
|
left: parent.left
|
||||||
|
@ -153,6 +152,7 @@ Item {
|
||||||
left: parent.left
|
left: parent.left
|
||||||
right: parent.right
|
right: parent.right
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
|
bottomMargin: 4
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,14 +82,14 @@ Dialog {
|
||||||
QtObject {
|
QtObject {
|
||||||
id: internal
|
id: internal
|
||||||
|
|
||||||
function buttonWidth() {
|
/*function buttonWidth() {
|
||||||
switch (buttonTexts.length) {
|
switch (buttonTexts.length) {
|
||||||
case 0: return 0
|
case 0: return 0
|
||||||
case 1: return Math.round((800 - 3 * 4) / 2)
|
case 1: return Math.round((800 - 3 * 4) / 2)
|
||||||
default: return (buttonContainer.width - (buttonTexts.length + 1) *
|
default: return (buttonContainer.width - (buttonTexts.length + 1) *
|
||||||
4) / buttonTexts.length
|
4) / buttonTexts.length
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
function iconSource() {
|
function iconSource() {
|
||||||
return root.titleIcon
|
return root.titleIcon
|
||||||
|
@ -145,20 +145,13 @@ Dialog {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
buttons: Item {
|
buttons: Row {
|
||||||
id: buttonContainer
|
id: buttonRow
|
||||||
|
|
||||||
LayoutMirroring.enabled: false
|
LayoutMirroring.enabled: false
|
||||||
LayoutMirroring.childrenInherit: true
|
LayoutMirroring.childrenInherit: true
|
||||||
|
|
||||||
width: parent.width
|
|
||||||
height: buttonTexts.length ? 48 + 2 * 2 : 0
|
|
||||||
|
|
||||||
Row {
|
|
||||||
id: buttonRow
|
|
||||||
objectName: "buttonRow"
|
objectName: "buttonRow"
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
spacing: 4
|
spacing: 4
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -112,6 +112,7 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
mainItem: Item {
|
mainItem: Item {
|
||||||
|
id: mainItem
|
||||||
width: theme.defaultFont.mSize.width * 40
|
width: theme.defaultFont.mSize.width * 40
|
||||||
height: titleBar.childrenRect.height + contentItem.childrenRect.height + buttonItem.childrenRect.height
|
height: titleBar.childrenRect.height + contentItem.childrenRect.height + buttonItem.childrenRect.height
|
||||||
|
|
||||||
|
@ -133,6 +134,8 @@ Item {
|
||||||
Item {
|
Item {
|
||||||
id: contentItem
|
id: contentItem
|
||||||
|
|
||||||
|
onChildrenRectChanged: mainItem.width = Math.max(childrenRect.width, buttonItem.childrenRect.width)
|
||||||
|
|
||||||
clip: true
|
clip: true
|
||||||
anchors {
|
anchors {
|
||||||
top: titleBar.bottom
|
top: titleBar.bottom
|
||||||
|
@ -146,11 +149,11 @@ Item {
|
||||||
id: buttonItem
|
id: buttonItem
|
||||||
|
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
clip: true
|
|
||||||
anchors {
|
anchors {
|
||||||
left: parent.left
|
left: parent.left
|
||||||
right: parent.right
|
right: parent.right
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
|
bottomMargin: 4
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user