mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-18 07:55:21 +01:00
qml: UseSavedSettingsPopup: Qt6 fixes
Use anchors preferentially, and nest the title bar elements
This commit is contained in:
parent
f4f43c7124
commit
cf8c4bc66d
1 changed files with 43 additions and 40 deletions
|
@ -13,7 +13,7 @@ Popup {
|
||||||
id: msgpopup
|
id: msgpopup
|
||||||
x: (parent.width-width)/2
|
x: (parent.width-width)/2
|
||||||
y: (parent.height-height)/2
|
y: (parent.height-height)/2
|
||||||
width: Math.max(buttons.width+10, parent.width-150)
|
width: 550
|
||||||
height: msgpopupbody.implicitHeight+150
|
height: msgpopupbody.implicitHeight+150
|
||||||
padding: 0
|
padding: 0
|
||||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
||||||
|
@ -29,63 +29,69 @@ Popup {
|
||||||
|
|
||||||
// background of title
|
// background of title
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
id: msgpopup_title_background
|
||||||
color: "#f5f5f5"
|
color: "#f5f5f5"
|
||||||
anchors.right: parent.right
|
anchors.left: parent.left
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
height: 35
|
height: 35
|
||||||
width: parent.width
|
width: parent.width
|
||||||
}
|
|
||||||
// line under title
|
|
||||||
Rectangle {
|
|
||||||
color: "#afafaf"
|
|
||||||
width: parent.width
|
|
||||||
y: 35
|
|
||||||
implicitHeight: 1
|
|
||||||
}
|
|
||||||
|
|
||||||
Text {
|
|
||||||
id: msgx
|
|
||||||
text: "X"
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.rightMargin: 25
|
|
||||||
anchors.topMargin: 10
|
|
||||||
font.family: roboto.name
|
|
||||||
font.bold: true
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: {
|
|
||||||
msgpopup.close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ColumnLayout {
|
|
||||||
spacing: 20
|
|
||||||
anchors.fill: parent
|
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: msgpopupheader
|
id: msgpopupheader
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
verticalAlignment: Text.AlignVCenter
|
anchors.fill: parent
|
||||||
Layout.fillWidth: true
|
anchors.topMargin: 10
|
||||||
Layout.topMargin: 10
|
|
||||||
font.family: roboto.name
|
font.family: roboto.name
|
||||||
font.bold: true
|
font.bold: true
|
||||||
text: qsTr("Use OS customization?")
|
text: qsTr("Use OS customization?")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
text: "X"
|
||||||
|
Layout.alignment: Qt.AlignRight
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.rightMargin: 25
|
||||||
|
anchors.topMargin: 10
|
||||||
|
font.family: roboto.name
|
||||||
|
font.bold: true
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
onClicked: {
|
||||||
|
msgpopup.close()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// line under title
|
||||||
|
Rectangle {
|
||||||
|
id: msgpopup_title_separator
|
||||||
|
color: "#afafaf"
|
||||||
|
width: parent.width
|
||||||
|
anchors.top: msgpopup_title_background.bottom
|
||||||
|
height: 1
|
||||||
|
}
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
spacing: 20
|
||||||
|
anchors.top: msgpopup_title_separator.bottom
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: msgpopupbody
|
id: msgpopupbody
|
||||||
font.pointSize: 12
|
font.pointSize: 12
|
||||||
wrapMode: Text.Wrap
|
wrapMode: Text.Wrap
|
||||||
textFormat: Text.StyledText
|
textFormat: Text.StyledText
|
||||||
font.family: roboto.name
|
font.family: roboto.name
|
||||||
Layout.maximumWidth: msgpopup.width-50
|
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.leftMargin: 25
|
Layout.leftMargin: 25
|
||||||
|
Layout.rightMargin: 25
|
||||||
Layout.topMargin: 25
|
Layout.topMargin: 25
|
||||||
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
|
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
|
||||||
Accessible.name: text.replace(/<\/?[^>]+(>|$)/g, "")
|
Accessible.name: text.replace(/<\/?[^>]+(>|$)/g, "")
|
||||||
|
@ -95,7 +101,6 @@ Popup {
|
||||||
RowLayout {
|
RowLayout {
|
||||||
Layout.alignment: Qt.AlignCenter | Qt.AlignBottom
|
Layout.alignment: Qt.AlignCenter | Qt.AlignBottom
|
||||||
Layout.bottomMargin: 10
|
Layout.bottomMargin: 10
|
||||||
spacing: 20
|
|
||||||
id: buttons
|
id: buttons
|
||||||
|
|
||||||
ImButtonRed {
|
ImButtonRed {
|
||||||
|
@ -137,8 +142,6 @@ Popup {
|
||||||
msgpopup.no()
|
msgpopup.no()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Text { text: " " }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue