diff --git a/electrum/gui/qml/components/Constants.qml b/electrum/gui/qml/components/Constants.qml index ce14c40c7..51de82c92 100644 --- a/electrum/gui/qml/components/Constants.qml +++ b/electrum/gui/qml/components/Constants.qml @@ -32,4 +32,7 @@ Item { property color colorLightningLocal: "blue" property color colorLightningRemote: "yellow" + function colorAlpha(baseColor, alpha) { + return Qt.rgba(baseColor.r, baseColor.g, baseColor.b, alpha) + } } diff --git a/electrum/gui/qml/components/History.qml b/electrum/gui/qml/components/History.qml index 565d11847..0594c485d 100644 --- a/electrum/gui/qml/components/History.qml +++ b/electrum/gui/qml/components/History.qml @@ -10,7 +10,8 @@ import "controls" Pane { id: rootItem - visible: Daemon.currentWallet !== undefined + visible: Daemon.currentWallet + padding: 0 clip: true ListView { @@ -62,6 +63,48 @@ Pane { } + MouseArea { + id: vdragscroll + anchors { + top: listview.top + right: listview.right + bottom: listview.bottom + } + width: constants.paddingXXLarge + drag.target: dragb + onPressedChanged: if (pressed) { + dragb.y = mouseY - dragb.height/2 + } + } + + Rectangle { + id: dragb + anchors.right: vdragscroll.left + width: postext.width + constants.paddingXXLarge + height: postext.height + constants.paddingXXLarge + radius: constants.paddingXSmall + + color: constants._alpha(Material.accentColor, 0.33) + border.color: Material.accentColor + opacity : vdragscroll.drag.active ? 1 : 0 + Behavior on opacity { NumberAnimation { duration: 300 } } + + onYChanged: { + if (vdragscroll.drag.active) { + listview.contentY = + Math.min(listview.contentHeight - listview.height + listview.originY, + Math.max(listview.originY, + (y/vdragscroll.height) * listview.contentHeight)) + } + } + Label { + id: postext + anchors.centerIn: parent + text: listview.itemAt(0,listview.contentY + (dragb.y + dragb.height/2)).delegateModel.date + font.pixelSize: constants.fontSizeLarge + } + } + Connections { target: Network function onHeightChanged(height) { diff --git a/electrum/gui/qml/components/controls/HistoryItemDelegate.qml b/electrum/gui/qml/components/controls/HistoryItemDelegate.qml index 983465320..ae9b49c20 100644 --- a/electrum/gui/qml/components/controls/HistoryItemDelegate.qml +++ b/electrum/gui/qml/components/controls/HistoryItemDelegate.qml @@ -10,6 +10,9 @@ Item { width: ListView.view.width height: delegateLayout.height + // expose delegate model for scroll indicator + property var delegateModel: model + ColumnLayout { id: delegateLayout width: parent.width