Browse Source

qml: unify dialog headers

patch-4
Sander van Grieken 3 years ago
parent
commit
68b630a2e9
  1. 27
      electrum/gui/qml/components/GenericShareDialog.qml
  2. 33
      electrum/gui/qml/components/OpenWalletDialog.qml
  3. 34
      electrum/gui/qml/components/PasswordDialog.qml
  4. 34
      electrum/gui/qml/components/Pin.qml
  5. 14
      electrum/gui/qml/components/RequestDialog.qml
  6. 39
      electrum/gui/qml/components/controls/ElDialog.qml

27
electrum/gui/qml/components/GenericShareDialog.qml

@ -14,6 +14,7 @@ ElDialog {
property string text_help property string text_help
title: '' title: ''
parent: Overlay.overlay parent: Overlay.overlay
modal: true modal: true
standardButtons: Dialog.Close standardButtons: Dialog.Close
@ -25,19 +26,19 @@ ElDialog {
color: "#aa000000" color: "#aa000000"
} }
header: RowLayout { // header: RowLayout {
width: dialog.width // width: dialog.width
Label { // Label {
Layout.fillWidth: true // Layout.fillWidth: true
text: dialog.title // text: dialog.title
visible: dialog.title // visible: dialog.title
elide: Label.ElideRight // elide: Label.ElideRight
padding: constants.paddingXLarge // padding: constants.paddingXLarge
bottomPadding: 0 // bottomPadding: 0
font.bold: true // font.bold: true
font.pixelSize: constants.fontSizeMedium // font.pixelSize: constants.fontSizeMedium
} // }
} // }
Flickable { Flickable {
anchors.fill: parent anchors.fill: parent

33
electrum/gui/qml/components/OpenWalletDialog.qml

@ -14,6 +14,7 @@ ElDialog {
height: parent.height height: parent.height
title: qsTr("Open Wallet") title: qsTr("Open Wallet")
iconSource: '../../../icons/wallet.png'
property string name property string name
property string path property string path
@ -30,38 +31,6 @@ ElDialog {
property bool _unlockClicked: false property bool _unlockClicked: false
header: GridLayout {
columns: 2
rowSpacing: 0
Image {
source: "../../icons/wallet.png"
Layout.preferredWidth: constants.iconSizeXLarge
Layout.preferredHeight: constants.iconSizeXLarge
Layout.leftMargin: constants.paddingMedium
Layout.topMargin: constants.paddingMedium
Layout.bottomMargin: constants.paddingMedium
}
Label {
text: title
Layout.fillWidth: true
topPadding: constants.paddingXLarge
bottomPadding: constants.paddingXLarge
font.bold: true
font.pixelSize: constants.fontSizeMedium
}
Rectangle {
Layout.columnSpan: 2
Layout.fillWidth: true
Layout.leftMargin: constants.paddingXXSmall
Layout.rightMargin: constants.paddingXXSmall
height: 1
color: Qt.rgba(0,0,0,0.5)
}
}
ColumnLayout { ColumnLayout {
width: parent.width width: parent.width
spacing: constants.paddingLarge spacing: constants.paddingLarge

34
electrum/gui/qml/components/PasswordDialog.qml

@ -11,6 +11,7 @@ ElDialog {
id: passworddialog id: passworddialog
title: qsTr("Enter Password") title: qsTr("Enter Password")
iconSource: '../../../icons/lock.png'
property bool confirmPassword: false property bool confirmPassword: false
property string password property string password
@ -24,39 +25,6 @@ ElDialog {
color: "#aa000000" color: "#aa000000"
} }
header: GridLayout {
columns: 2
rowSpacing: 0
Image {
source: "../../icons/lock.png"
Layout.preferredWidth: constants.iconSizeXLarge
Layout.preferredHeight: constants.iconSizeXLarge
Layout.leftMargin: constants.paddingMedium
Layout.topMargin: constants.paddingMedium
Layout.bottomMargin: constants.paddingMedium
}
Label {
text: title
elide: Label.ElideRight
Layout.fillWidth: true
topPadding: constants.paddingXLarge
bottomPadding: constants.paddingXLarge
font.bold: true
font.pixelSize: constants.fontSizeMedium
}
Rectangle {
Layout.columnSpan: 2
Layout.fillWidth: true
Layout.leftMargin: constants.paddingXXSmall
Layout.rightMargin: constants.paddingXXSmall
height: 1
color: Qt.rgba(0,0,0,0.5)
}
}
ColumnLayout { ColumnLayout {
width: parent.width width: parent.width

34
electrum/gui/qml/components/Pin.qml

@ -11,6 +11,7 @@ ElDialog {
id: root id: root
title: qsTr('PIN') title: qsTr('PIN')
iconSource: '../../../icons/lock.png'
width: parent.width * 2/3 width: parent.width * 2/3
height: parent.height * 1/3 height: parent.height * 1/3
@ -75,39 +76,6 @@ ElDialog {
} }
} }
header: GridLayout {
columns: 2
rowSpacing: 0
Image {
source: "../../icons/lock.png"
Layout.preferredWidth: constants.iconSizeXLarge
Layout.preferredHeight: constants.iconSizeXLarge
Layout.leftMargin: constants.paddingMedium
Layout.topMargin: constants.paddingMedium
Layout.bottomMargin: constants.paddingMedium
}
Label {
text: title
elide: Label.ElideRight
Layout.fillWidth: true
topPadding: constants.paddingXLarge
bottomPadding: constants.paddingXLarge
font.bold: true
font.pixelSize: constants.fontSizeMedium
}
Rectangle {
Layout.columnSpan: 2
Layout.fillWidth: true
Layout.leftMargin: constants.paddingXXSmall
Layout.rightMargin: constants.paddingXXSmall
height: 1
color: Qt.rgba(0,0,0,0.5)
}
}
ColumnLayout { ColumnLayout {
width: parent.width width: parent.width
height: parent.height height: parent.height

14
electrum/gui/qml/components/RequestDialog.qml

@ -30,20 +30,6 @@ ElDialog {
color: "#aa000000" color: "#aa000000"
} }
header: RowLayout {
width: dialog.width
Label {
Layout.fillWidth: true
text: dialog.title
visible: dialog.title
elide: Label.ElideRight
padding: constants.paddingXLarge
bottomPadding: 0
font.bold: true
font.pixelSize: constants.fontSizeMedium
}
}
Flickable { Flickable {
anchors.fill: parent anchors.fill: parent
contentHeight: rootLayout.height contentHeight: rootLayout.height

39
electrum/gui/qml/components/controls/ElDialog.qml

@ -6,6 +6,7 @@ Dialog {
id: abstractdialog id: abstractdialog
property bool allowClose: true property bool allowClose: true
property string iconSource
onOpenedChanged: { onOpenedChanged: {
if (opened) { if (opened) {
@ -14,4 +15,42 @@ Dialog {
app.activeDialogs.pop() app.activeDialogs.pop()
} }
} }
header: ColumnLayout {
spacing: 0
RowLayout {
spacing: 0
Image {
visible: iconSource
source: iconSource
Layout.preferredWidth: constants.iconSizeXLarge
Layout.preferredHeight: constants.iconSizeXLarge
Layout.leftMargin: constants.paddingMedium
Layout.topMargin: constants.paddingMedium
Layout.bottomMargin: constants.paddingMedium
}
Label {
text: title
elide: Label.ElideRight
Layout.fillWidth: true
leftPadding: constants.paddingXLarge
topPadding: constants.paddingXLarge
bottomPadding: constants.paddingXLarge
font.bold: true
font.pixelSize: constants.fontSizeMedium
}
}
Rectangle {
Layout.fillWidth: true
Layout.leftMargin: constants.paddingXXSmall
Layout.rightMargin: constants.paddingXXSmall
height: 1
color: Qt.rgba(0,0,0,0.5)
}
}
} }

Loading…
Cancel
Save