From cf005a0f2a4371d43f337efd78b0d86c012f3539 Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Fri, 21 Oct 2022 14:11:14 +0200 Subject: [PATCH] qml: ui close channel dialog --- .../gui/qml/components/CloseChannelDialog.qml | 145 ++++++++++-------- 1 file changed, 81 insertions(+), 64 deletions(-) diff --git a/electrum/gui/qml/components/CloseChannelDialog.qml b/electrum/gui/qml/components/CloseChannelDialog.qml index dcd5e776f..a0ee83f6c 100644 --- a/electrum/gui/qml/components/CloseChannelDialog.qml +++ b/electrum/gui/qml/components/CloseChannelDialog.qml @@ -26,68 +26,104 @@ ElDialog { closePolicy: Popup.NoAutoClose - GridLayout { - id: layout + padding: 0 + + ColumnLayout { width: parent.width height: parent.height - columns: 2 + spacing: 0 - Label { - text: qsTr('Channel name') - color: Material.accentColor - } + GridLayout { + id: layout + Layout.preferredWidth: parent.width + Layout.leftMargin: constants.paddingLarge + Layout.rightMargin: constants.paddingLarge + columns: 2 - Label { - text: channeldetails.name - } + Label { + Layout.fillWidth: true + text: qsTr('Channel name') + color: Material.accentColor + } - Label { - text: qsTr('Short channel ID') - color: Material.accentColor - } + Label { + Layout.fillWidth: true + text: channeldetails.name + } - Label { - text: channeldetails.short_cid - } + Label { + text: qsTr('Short channel ID') + color: Material.accentColor + } - InfoTextArea { - Layout.columnSpan: 2 - text: qsTr(channeldetails.message_force_close) - } + Label { + text: channeldetails.short_cid + } - ColumnLayout { - Layout.columnSpan: 2 - Layout.alignment: Qt.AlignHCenter + Item { Layout.preferredHeight: constants.paddingMedium; Layout.preferredWidth: 1; Layout.columnSpan: 2 } - ButtonGroup { - id: closetypegroup + InfoTextArea { + Layout.columnSpan: 2 + Layout.preferredWidth: parent.width * 3/4 + Layout.alignment: Qt.AlignHCenter + text: qsTr(channeldetails.message_force_close) } - RadioButton { - ButtonGroup.group: closetypegroup - property string closetype: 'cooperative' - checked: true - enabled: !closing && channeldetails.canCoopClose - text: qsTr('Cooperative close') - } - RadioButton { - ButtonGroup.group: closetypegroup - property string closetype: 'remote_force' - enabled: !closing && channeldetails.canForceClose - text: qsTr('Request Force-close') + ColumnLayout { + Layout.columnSpan: 2 + Layout.alignment: Qt.AlignHCenter + + ButtonGroup { + id: closetypegroup + } + + RadioButton { + ButtonGroup.group: closetypegroup + property string closetype: 'cooperative' + checked: true + enabled: !closing && channeldetails.canCoopClose + text: qsTr('Cooperative close') + } + RadioButton { + ButtonGroup.group: closetypegroup + property string closetype: 'remote_force' + enabled: !closing && channeldetails.canForceClose + text: qsTr('Request Force-close') + } + RadioButton { + ButtonGroup.group: closetypegroup + property string closetype: 'local_force' + enabled: !closing && channeldetails.canForceClose + text: qsTr('Local Force-close') + } } - RadioButton { - ButtonGroup.group: closetypegroup - property string closetype: 'local_force' - enabled: !closing && channeldetails.canForceClose - text: qsTr('Local Force-close') + + ColumnLayout { + Layout.columnSpan: 2 + Layout.alignment: Qt.AlignHCenter + Label { + id: errorText + visible: !closing && errorText + wrapMode: Text.Wrap + Layout.preferredWidth: layout.width + } + Label { + text: qsTr('Closing...') + visible: closing + } + BusyIndicator { + visible: closing + } } } - Button { + Item { Layout.fillHeight: true; Layout.preferredWidth: 1 } + + FlatButton { Layout.columnSpan: 2 - Layout.alignment: Qt.AlignHCenter + Layout.fillWidth: true text: qsTr('Close') + icon.source: '../../icons/closebutton.png' enabled: !closing onClicked: { closing = true @@ -96,25 +132,6 @@ ElDialog { } - ColumnLayout { - Layout.columnSpan: 2 - Layout.alignment: Qt.AlignHCenter - Label { - id: errorText - visible: !closing && errorText - wrapMode: Text.Wrap - Layout.preferredWidth: layout.width - } - Label { - text: qsTr('Closing...') - visible: closing - } - BusyIndicator { - visible: closing - } - } - Item { Layout.fillHeight: true; Layout.preferredWidth: 1 } - } ChannelDetails {