Browse Source

qml: take internal, external, billing address colors from desktop client and color output addresses

accordingly in ConfirmTxDialog, TxDetails, CpfpBumpFeeDialog, RbfBumpFeeDialog and RbfCancelDialog
master
Sander van Grieken 3 years ago
parent
commit
9d11aae394
  1. 8
      electrum/gui/qml/components/ConfirmTxDialog.qml
  2. 6
      electrum/gui/qml/components/Constants.qml
  3. 8
      electrum/gui/qml/components/CpfpBumpFeeDialog.qml
  4. 8
      electrum/gui/qml/components/RbfBumpFeeDialog.qml
  5. 8
      electrum/gui/qml/components/RbfCancelDialog.qml
  6. 8
      electrum/gui/qml/components/TxDetails.qml
  7. 6
      electrum/gui/qml/qetxdetails.py
  8. 4
      electrum/gui/qml/qetxfinalizer.py

8
electrum/gui/qml/components/ConfirmTxDialog.qml

@ -194,7 +194,13 @@ ElDialog {
wrapMode: Text.Wrap
font.pixelSize: constants.fontSizeLarge
font.family: FixedFont
color: modelData.is_mine ? constants.colorMine : Material.foreground
color: modelData.is_mine
? modelData.is_change
? constants.colorAddressInternal
: constants.colorAddressExternal
: modelData.is_billing
? constants.colorAddressBilling
: Material.foreground
}
Label {
text: Config.formatSats(modelData.value_sats)

6
electrum/gui/qml/components/Constants.qml

@ -41,7 +41,6 @@ Item {
property color colorProgress: '#ffffff80'
property color colorDone: '#ff80ff80'
property color colorMine: "yellow"
property color colorLightningLocal: "blue"
property color colorLightningRemote: "yellow"
property color colorChannelOpen: "#ff80ff80"
@ -57,11 +56,12 @@ Item {
property color colorPiechartParticipant: 'gray'
property color colorPiechartSignature: 'yellow'
property color colorAddressExternal: Qt.rgba(0,1,0,0.5)
property color colorAddressInternal: Qt.rgba(1,0.93,0,0.75)
property color colorAddressExternal: "#8af296" //Qt.rgba(0,1,0,0.5)
property color colorAddressInternal: "#ffff00" //Qt.rgba(1,0.93,0,0.75)
property color colorAddressUsed: Qt.rgba(0.5,0.5,0.5,1)
property color colorAddressUsedWithBalance: Qt.rgba(0.75,0.75,0.75,1)
property color colorAddressFrozen: Qt.rgba(0.5,0.5,1,1)
property color colorAddressBilling: "#8cb3f2"
function colorAlpha(baseColor, alpha) {
return Qt.rgba(baseColor.r, baseColor.g, baseColor.b, alpha)

8
electrum/gui/qml/components/CpfpBumpFeeDialog.qml

@ -197,7 +197,13 @@ ElDialog {
wrapMode: Text.Wrap
font.pixelSize: constants.fontSizeLarge
font.family: FixedFont
color: modelData.is_mine ? constants.colorMine : Material.foreground
color: modelData.is_mine
? modelData.is_change
? constants.colorAddressInternal
: constants.colorAddressExternal
: modelData.is_billing
? constants.colorAddressBilling
: Material.foreground
}
Label {
text: Config.formatSats(modelData.value_sats)

8
electrum/gui/qml/components/RbfBumpFeeDialog.qml

@ -210,7 +210,13 @@ ElDialog {
wrapMode: Text.Wrap
font.pixelSize: constants.fontSizeLarge
font.family: FixedFont
color: modelData.is_mine ? constants.colorMine : Material.foreground
color: modelData.is_mine
? modelData.is_change
? constants.colorAddressInternal
: constants.colorAddressExternal
: modelData.is_billing
? constants.colorAddressBilling
: Material.foreground
}
Label {
text: Config.formatSats(modelData.value_sats)

8
electrum/gui/qml/components/RbfCancelDialog.qml

@ -169,7 +169,13 @@ ElDialog {
wrapMode: Text.Wrap
font.pixelSize: constants.fontSizeLarge
font.family: FixedFont
color: modelData.is_mine ? constants.colorMine : Material.foreground
color: modelData.is_mine
? modelData.is_change
? constants.colorAddressInternal
: constants.colorAddressExternal
: modelData.is_billing
? constants.colorAddressBilling
: Material.foreground
}
Label {
text: Config.formatSats(modelData.value_sats)

8
electrum/gui/qml/components/TxDetails.qml

@ -279,7 +279,13 @@ Pane {
wrapMode: Text.Wrap
font.pixelSize: constants.fontSizeLarge
font.family: FixedFont
color: modelData.is_mine ? constants.colorMine : Material.foreground
color: modelData.is_mine
? modelData.is_change
? constants.colorAddressInternal
: constants.colorAddressExternal
: modelData.is_billing
? constants.colorAddressBilling
: Material.foreground
}
Label {
text: Config.formatSats(modelData.value)

6
electrum/gui/qml/qetxdetails.py

@ -247,8 +247,10 @@ class QETxDetails(QObject, QtEventListener):
self._outputs = list(map(lambda x: {
'address': x.get_ui_address_str(),
'value': QEAmount(amount_sat=x.value),
'is_mine': self._wallet.wallet.is_mine(x.get_ui_address_str())
}, self._tx.outputs()))
'is_mine': self._wallet.wallet.is_mine(x.get_ui_address_str()),
'is_change': self._wallet.wallet.is_change(x.get_ui_address_str()),
'is_billing': self._wallet.wallet.is_billing_address(x.get_ui_address_str())
}, self._tx.outputs()))
txinfo = self._wallet.wallet.get_tx_info(self._tx)

4
electrum/gui/qml/qetxfinalizer.py

@ -214,7 +214,9 @@ class TxFeeSlider(FeeSlider):
outputs.append({
'address': o.get_ui_address_str(),
'value_sats': o.value,
'is_mine': self._wallet.wallet.is_mine(o.get_ui_address_str())
'is_mine': self._wallet.wallet.is_mine(o.get_ui_address_str()),
'is_change': self._wallet.wallet.is_change(o.get_ui_address_str()),
'is_billing': self._wallet.wallet.is_billing_address(o.get_ui_address_str())
})
self.outputs = outputs

Loading…
Cancel
Save