Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more triggers to scroll asks to bottom in pro orderbook #2455

Merged
merged 4 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 45 additions & 4 deletions atomic_defi_design/Dex/Exchange/Trade/OrderBook/List.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Item
id: _control

property bool isAsk
property bool isVertical: false
width: parent.width
height: parent.height

Expand All @@ -29,7 +28,11 @@ Item

onContentHeightChanged:
{
if (isVertical) _tm.start();
if (isAsk){
// Duplication is intended. Sometimes data takes too long to load so slowscroll is a backup.
slowscroll_timer.start();
quickscroll_timer.start()
}
}

delegate: Item
Expand All @@ -47,12 +50,50 @@ Item

Timer
{
id: _tm
interval: 2000
id: slowscroll_timer
interval: 1500
onTriggered:
{
orderbook_list.positionViewAtEnd()
}
}
Timer
{
id: quickscroll_timer
interval: 500
onTriggered:
{
orderbook_list.positionViewAtEnd()
}
}
onModelChanged: {
if (isAsk) quickscroll_timer.start()
}
}

Connections {
target: API.app.trading_pg;

function onMarketModeChanged()
{
if (isAsk)
{
quickscroll_timer.start()
}
}
function onOrderbookChanged()
{
if (isAsk)
{
quickscroll_timer.start()
}
}
function onMarketPairsChanged()
{
if (isAsk)
{
quickscroll_timer.start()
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ Widget
List
{
isAsk: true
isVertical: true
Layout.fillHeight: true
Layout.fillWidth: true
}
Expand Down
Loading