Browse Source

qml: styling MessageDialog

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

29
electrum/gui/qml/components/MessageDialog.qml

@ -28,7 +28,12 @@ ElDialog {
color: "#aa000000" color: "#aa000000"
} }
padding: 0
ColumnLayout {
ColumnLayout { ColumnLayout {
Layout.margins: constants.paddingMedium
Layout.alignment: Qt.AlignHCenter
TextArea { TextArea {
id: message id: message
Layout.preferredWidth: Overlay.overlay.width *2/3 Layout.preferredWidth: Overlay.overlay.width *2/3
@ -39,24 +44,38 @@ ElDialog {
color: 'transparent' color: 'transparent'
} }
} }
}
RowLayout { ButtonContainer {
Layout.alignment: Qt.AlignHCenter Layout.fillWidth: true
Button {
FlatButton {
Layout.fillWidth: true
textUnderIcon: false
text: qsTr('Ok') text: qsTr('Ok')
icon.source: Qt.resolvedUrl('../../icons/confirmed.png')
visible: !yesno visible: !yesno
onClicked: dialog.close() onClicked: dialog.close()
} }
Button {
FlatButton {
Layout.fillWidth: true
Layout.preferredWidth: 1
textUnderIcon: false
text: qsTr('Yes') text: qsTr('Yes')
icon.source: Qt.resolvedUrl('../../icons/confirmed.png')
visible: yesno visible: yesno
onClicked: { onClicked: {
yesClicked() yesClicked()
dialog.close() dialog.close()
} }
} }
Button { FlatButton {
Layout.fillWidth: true
Layout.preferredWidth: 1
textUnderIcon: false
text: qsTr('No') text: qsTr('No')
icon.source: Qt.resolvedUrl('../../icons/closebutton.png')
visible: yesno visible: yesno
onClicked: { onClicked: {
reject() reject()

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

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

Loading…
Cancel
Save