Browse Source

qml: channels styling

patch-4
Sander van Grieken 2 years ago
parent
commit
725a05643e
  1. 83
      electrum/gui/qml/components/Channels.qml
  2. 15
      electrum/gui/qml/components/controls/ChannelDelegate.qml

83
electrum/gui/qml/components/Channels.qml

@ -9,45 +9,21 @@ import "controls"
Pane {
id: root
property QtObject menu: Menu {
id: menu
parent: Overlay.overlay
dim: true
Overlay.modeless: Rectangle {
color: "#44000000"
}
MenuItem {
icon.color: 'transparent'
action: Action {
text: qsTr('Swap');
enabled: Daemon.currentWallet.lightningCanSend.satsInt > 0 || Daemon.currentWallet.lightningCanReceive.satInt > 0
onTriggered: {
var dialog = swapDialog.createObject(root)
dialog.open()
}
icon.source: '../../icons/status_waiting.png'
}
}
MenuSeparator {}
MenuItem {
icon.color: 'transparent'
action: Action {
text: qsTr('Open Channel');
onTriggered: app.stack.push(Qt.resolvedUrl('OpenChannel.qml'))
icon.source: '../../icons/lightning.png'
}
}
}
padding: 0
ColumnLayout {
id: layout
width: parent.width
height: parent.height
spacing: 0
GridLayout {
id: summaryLayout
Layout.preferredWidth: parent.width
Layout.fillWidth: true
Layout.topMargin: constants.paddingLarge
Layout.leftMargin: constants.paddingLarge
Layout.rightMargin: constants.paddingLarge
columns: 2
Label {
@ -116,8 +92,13 @@ Pane {
Frame {
id: channelsFrame
Layout.preferredWidth: parent.width
Layout.fillWidth: true
Layout.fillHeight: true
Layout.topMargin: constants.paddingLarge
Layout.bottomMargin: constants.paddingLarge
Layout.leftMargin: constants.paddingMedium
Layout.rightMargin: constants.paddingMedium
verticalPadding: 0
horizontalPadding: 0
background: PaneInsetBackground {}
@ -126,24 +107,6 @@ Pane {
spacing: 0
anchors.fill: parent
Item {
Layout.preferredHeight: hitem.height
Layout.preferredWidth: parent.width
Rectangle {
anchors.fill: parent
color: Qt.lighter(Material.background, 1.25)
}
RowLayout {
id: hitem
width: parent.width
Label {
text: qsTr('Channels')
font.pixelSize: constants.fontSizeLarge
color: Material.accentColor
}
}
}
ListView {
id: listview
Layout.preferredWidth: parent.width
@ -162,15 +125,25 @@ Pane {
}
}
RowLayout {
Layout.alignment: Qt.AlignHCenter
FlatButton {
Layout.fillWidth: true
Button {
text: qsTr('Open Channel')
onClicked: app.stack.push(Qt.resolvedUrl('OpenChannel.qml'))
text: qsTr('Swap');
visible: Daemon.currentWallet.lightningCanSend.satsInt > 0 || Daemon.currentWallet.lightningCanReceive.satInt > 0
icon.source: '../../icons/status_waiting.png'
onClicked: {
var dialog = swapDialog.createObject(root)
dialog.open()
}
}
FlatButton {
Layout.fillWidth: true
text: qsTr('Open Channel')
onClicked: app.stack.push(Qt.resolvedUrl('OpenChannel.qml'))
icon.source: '../../icons/lightning.png'
}
}
Component {

15
electrum/gui/qml/components/controls/ChannelDelegate.qml

@ -30,13 +30,13 @@ ItemDelegate {
Rectangle {
Layout.columnSpan: 2
Layout.fillWidth: true
Layout.preferredHeight: constants.paddingTiny
Layout.preferredHeight: constants.paddingXXSmall
color: 'transparent'
}
Image {
id: walleticon
source: "../../../icons/lightning.png"
source: model.is_trampoline ? '../../../icons/kangaroo.png' : '../../../icons/lightning.png'
fillMode: Image.PreserveAspectFit
Layout.rowSpan: 3
Layout.preferredWidth: constants.iconSizeLarge
@ -45,13 +45,13 @@ ItemDelegate {
Image {
visible: model.is_trampoline
source: "../../../icons/kangaroo.png"
source: '../../../icons/lightning.png'
anchors {
right: parent.right
bottom: parent.bottom
}
width: parent.width * 2/3
height: parent.height * 2/3
width: parent.width * 1/3
height: parent.height * 1/3
}
}
@ -136,11 +136,10 @@ ItemDelegate {
height: 1
}
Rectangle {
Item {
Layout.columnSpan: 2
Layout.fillWidth: true
Layout.preferredHeight: constants.paddingTiny
color: 'transparent'
Layout.preferredHeight: constants.paddingXXSmall
}
}

Loading…
Cancel
Save