initial channel list model and delegate
This commit is contained in:
80
electrum/gui/qml/components/controls/ChannelDelegate.qml
Normal file
80
electrum/gui/qml/components/controls/ChannelDelegate.qml
Normal file
@@ -0,0 +1,80 @@
|
||||
import QtQuick 2.6
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Layouts 1.0
|
||||
import QtQuick.Controls.Material 2.0
|
||||
|
||||
ItemDelegate {
|
||||
id: root
|
||||
height: item.height
|
||||
width: ListView.view.width
|
||||
|
||||
font.pixelSize: constants.fontSizeSmall // set default font size for child controls
|
||||
|
||||
GridLayout {
|
||||
id: item
|
||||
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
leftMargin: constants.paddingSmall
|
||||
rightMargin: constants.paddingSmall
|
||||
}
|
||||
|
||||
columns: 2
|
||||
|
||||
Rectangle {
|
||||
Layout.columnSpan: 2
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: constants.paddingTiny
|
||||
color: 'transparent'
|
||||
}
|
||||
|
||||
Image {
|
||||
id: walleticon
|
||||
source: "../../../icons/lightning.png"
|
||||
fillMode: Image.PreserveAspectFit
|
||||
Layout.rowSpan: 2
|
||||
Layout.preferredWidth: constants.iconSizeLarge
|
||||
Layout.preferredHeight: constants.iconSizeLarge
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
text: model.node_alias
|
||||
elide: Text.ElideRight
|
||||
wrapMode: Text.Wrap
|
||||
maximumLineCount: 2
|
||||
}
|
||||
|
||||
Label {
|
||||
text: model.state
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
text: model.short_cid
|
||||
}
|
||||
|
||||
Label {
|
||||
text: Config.formatSats(model.capacity)
|
||||
}
|
||||
|
||||
Label {
|
||||
text: Config.baseUnit
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
Layout.columnSpan: 2
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: constants.paddingTiny
|
||||
color: 'transparent'
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user