Browse Source

qml: make TextAreas more visible

master
Sander van Grieken 2 years ago
parent
commit
a57a0d001b
  1. 20
      electrum/gui/qml/components/ImportAddressesKeysDialog.qml
  2. 21
      electrum/gui/qml/components/LnurlPayRequestDialog.qml
  3. 12
      electrum/gui/qml/components/SignVerifyMessageDialog.qml
  4. 11
      electrum/gui/qml/components/controls/ElTextArea.qml
  5. 8
      electrum/gui/qml/components/wizard/WCHaveMasterKey.qml
  6. 14
      electrum/gui/qml/components/wizard/WCImport.qml

20
electrum/gui/qml/components/ImportAddressesKeysDialog.qml

@ -45,20 +45,26 @@ ElDialog {
Layout.rightMargin: constants.paddingLarge Layout.rightMargin: constants.paddingLarge
Label { Label {
text: Daemon.currentWallet.isWatchOnly Layout.fillWidth: true
? qsTr('Import additional addresses') wrapMode: Text.Wrap
: qsTr('Import additional keys') text: (Daemon.currentWallet.isWatchOnly
? qsTr('Enter, paste or scan additional addresses')
: qsTr('Enter, paste or scan additional private keys')) +
'. ' + qsTr('You can add multiple, each on a separate line.')
} }
RowLayout { RowLayout {
TextArea { ElTextArea {
id: import_ta id: import_ta
Layout.fillWidth: true Layout.fillWidth: true
Layout.minimumHeight: 80 Layout.fillHeight: true
focus: true font.family: FixedFont
wrapMode: TextEdit.WrapAnywhere wrapMode: TextEdit.WrapAnywhere
onTextChanged: valid = verify(text) onTextChanged: valid = verify(text)
inputMethodHints: Qt.ImhSensitiveData | Qt.ImhNoPredictiveText inputMethodHints: Qt.ImhSensitiveData | Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase
background: PaneInsetBackground {
baseColor: constants.darkerDialogBackground
}
} }
ColumnLayout { ColumnLayout {
Layout.alignment: Qt.AlignTop Layout.alignment: Qt.AlignTop

21
electrum/gui/qml/components/LnurlPayRequestDialog.qml

@ -36,6 +36,14 @@ ElDialog {
Layout.rightMargin: constants.paddingLarge Layout.rightMargin: constants.paddingLarge
Layout.bottomMargin: constants.paddingLarge Layout.bottomMargin: constants.paddingLarge
InfoTextArea {
Layout.columnSpan: 2
Layout.fillWidth: true
compact: true
visible: invoiceParser.lnurlData['min_sendable_sat'] != invoiceParser.lnurlData['max_sendable_sat']
text: qsTr('Amount must be between %1 and %2 %3').arg(Config.formatSats(invoiceParser.lnurlData['min_sendable_sat'])).arg(Config.formatSats(invoiceParser.lnurlData['max_sendable_sat'])).arg(Config.baseUnit)
}
Label { Label {
text: qsTr('Provider') text: qsTr('Provider')
color: Material.accentColor color: Material.accentColor
@ -93,26 +101,17 @@ ElDialog {
} }
} }
InfoTextArea {
Layout.columnSpan: 2
Layout.fillWidth: true
compact: true
visible: invoiceParser.lnurlData['min_sendable_sat'] != invoiceParser.lnurlData['max_sendable_sat']
text: qsTr('Amount must be between %1 and %2 %3').arg(Config.formatSats(invoiceParser.lnurlData['min_sendable_sat'])).arg(Config.formatSats(invoiceParser.lnurlData['max_sendable_sat'])).arg(Config.baseUnit)
}
Label { Label {
Layout.columnSpan: 2 Layout.columnSpan: 2
visible: invoiceParser.lnurlData['comment_allowed'] > 0 visible: invoiceParser.lnurlData['comment_allowed'] > 0
text: qsTr('Message') text: qsTr('Message')
color: Material.accentColor color: Material.accentColor
} }
TextArea { ElTextArea {
id: comment id: comment
Layout.columnSpan: 2 Layout.columnSpan: 2
Layout.fillWidth: true Layout.fillWidth: true
Layout.leftMargin: constants.paddingLarge Layout.minimumHeight: 160
Layout.minimumHeight: 80
visible: invoiceParser.lnurlData['comment_allowed'] > 0 visible: invoiceParser.lnurlData['comment_allowed'] > 0
wrapMode: TextEdit.Wrap wrapMode: TextEdit.Wrap
placeholderText: qsTr('Enter an (optional) message for the receiver') placeholderText: qsTr('Enter an (optional) message for the receiver')

12
electrum/gui/qml/components/SignVerifyMessageDialog.qml

@ -101,6 +101,18 @@ ElDialog {
plaintext.text = AppController.clipboardToText() plaintext.text = AppController.clipboardToText()
} }
} }
ToolButton {
icon.source: '../../icons/share.png'
icon.color: enabled ? 'transparent' : Material.iconDisabledColor
enabled: plaintext.text
onClicked: {
var dialog = app.genericShareDialog.createObject(app, {
title: qsTr('Message'),
text_qr: plaintext.text
})
dialog.open()
}
}
} }
} }

11
electrum/gui/qml/components/controls/ElTextArea.qml

@ -1,7 +1,7 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Controls 2.14 import QtQuick.Controls
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material
import org.electrum 1.0 import org.electrum 1.0
@ -16,6 +16,9 @@ Flickable {
property alias wrapMode: edit.wrapMode property alias wrapMode: edit.wrapMode
property alias background: rootpane.background property alias background: rootpane.background
property alias font: edit.font property alias font: edit.font
property alias inputMethodHints: edit.inputMethodHints
property alias placeholderText: edit.placeholderText
property alias color: edit.color
contentWidth: rootpane.width contentWidth: rootpane.width
contentHeight: rootpane.height contentHeight: rootpane.height

8
electrum/gui/qml/components/wizard/WCHaveMasterKey.qml

@ -122,10 +122,10 @@ WizardComponent {
} }
RowLayout { RowLayout {
TextArea { ElTextArea {
id: masterkey_ta id: masterkey_ta
Layout.fillWidth: true Layout.fillWidth: true
Layout.minimumHeight: 80 Layout.minimumHeight: 160
font.family: FixedFont font.family: FixedFont
wrapMode: TextEdit.WrapAnywhere wrapMode: TextEdit.WrapAnywhere
onTextChanged: { onTextChanged: {
@ -133,8 +133,12 @@ WizardComponent {
verifyMasterKey(text) verifyMasterKey(text)
} }
inputMethodHints: Qt.ImhSensitiveData | Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase inputMethodHints: Qt.ImhSensitiveData | Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase
background: PaneInsetBackground {
baseColor: constants.darkerDialogBackground
}
} }
ColumnLayout { ColumnLayout {
Layout.alignment: Qt.AlignTop
ToolButton { ToolButton {
icon.source: '../../../icons/paste.png' icon.source: '../../../icons/paste.png'
icon.height: constants.iconSizeMedium icon.height: constants.iconSizeMedium

14
electrum/gui/qml/components/wizard/WCImport.qml

@ -26,7 +26,7 @@ WizardComponent {
ColumnLayout { ColumnLayout {
width: parent.width width: parent.width
height: parent.height
InfoTextArea { InfoTextArea {
Layout.preferredWidth: parent.width Layout.preferredWidth: parent.width
text: qsTr('Enter a list of Bitcoin addresses (this will create a watching-only wallet), or a list of private keys.') text: qsTr('Enter a list of Bitcoin addresses (this will create a watching-only wallet), or a list of private keys.')
@ -34,15 +34,21 @@ WizardComponent {
RowLayout { RowLayout {
Layout.topMargin: constants.paddingMedium Layout.topMargin: constants.paddingMedium
TextArea { Layout.fillHeight: true
ElTextArea {
id: import_ta id: import_ta
Layout.fillWidth: true Layout.fillWidth: true
Layout.minimumHeight: 80 Layout.fillHeight: true
focus: true font.family: FixedFont
wrapMode: TextEdit.WrapAnywhere wrapMode: TextEdit.WrapAnywhere
onTextChanged: valid = verify(text) onTextChanged: valid = verify(text)
inputMethodHints: Qt.ImhSensitiveData | Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase inputMethodHints: Qt.ImhSensitiveData | Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase
background: PaneInsetBackground {
baseColor: constants.darkerDialogBackground
}
} }
ColumnLayout { ColumnLayout {
Layout.alignment: Qt.AlignTop Layout.alignment: Qt.AlignTop
ToolButton { ToolButton {

Loading…
Cancel
Save