Browse Source

qml: styling MessageDialog

master
Sander van Grieken 3 years ago
parent
commit
f8e43b3149
  1. 45
      electrum/gui/qml/components/MessageDialog.qml
  2. 4
      electrum/gui/qml/components/controls/FlatButton.qml

45
electrum/gui/qml/components/MessageDialog.qml

@ -28,35 +28,54 @@ ElDialog {
color: "#aa000000"
}
padding: 0
ColumnLayout {
TextArea {
id: message
Layout.preferredWidth: Overlay.overlay.width *2/3
readOnly: true
wrapMode: TextInput.WordWrap
textFormat: richText ? TextEdit.RichText : TextEdit.PlainText
background: Rectangle {
color: 'transparent'
ColumnLayout {
Layout.margins: constants.paddingMedium
Layout.alignment: Qt.AlignHCenter
TextArea {
id: message
Layout.preferredWidth: Overlay.overlay.width *2/3
readOnly: true
wrapMode: TextInput.WordWrap
textFormat: richText ? TextEdit.RichText : TextEdit.PlainText
background: Rectangle {
color: 'transparent'
}
}
}
RowLayout {
Layout.alignment: Qt.AlignHCenter
Button {
ButtonContainer {
Layout.fillWidth: true
FlatButton {
Layout.fillWidth: true
textUnderIcon: false
text: qsTr('Ok')
icon.source: Qt.resolvedUrl('../../icons/confirmed.png')
visible: !yesno
onClicked: dialog.close()
}
Button {
FlatButton {
Layout.fillWidth: true
Layout.preferredWidth: 1
textUnderIcon: false
text: qsTr('Yes')
icon.source: Qt.resolvedUrl('../../icons/confirmed.png')
visible: yesno
onClicked: {
yesClicked()
dialog.close()
}
}
Button {
FlatButton {
Layout.fillWidth: true
Layout.preferredWidth: 1
textUnderIcon: false
text: qsTr('No')
icon.source: Qt.resolvedUrl('../../icons/closebutton.png')
visible: yesno
onClicked: {
reject()

4
electrum/gui/qml/components/controls/FlatButton.qml

@ -8,8 +8,10 @@ TabButton {
id: control
checkable: false
property bool textUnderIcon: true
font.pixelSize: constants.fontSizeSmall
display: IconLabel.TextUnderIcon
display: textUnderIcon ? IconLabel.TextUnderIcon : IconLabel.TextBesideIcon
contentItem: IconLabel {
spacing: control.spacing

Loading…
Cancel
Save