1
0

qml: channels styling

This commit is contained in:
Sander van Grieken
2022-11-11 16:23:24 +01:00
parent 18131e5a38
commit 725a05643e
2 changed files with 35 additions and 63 deletions

View File

@@ -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 {

View File

@@ -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
}
}