Skip to content

Commit

Permalink
more triggers to scroll asks to bottom in pro orderbook
Browse files Browse the repository at this point in the history
  • Loading branch information
smk762 committed Jun 13, 2024
1 parent 3f25b37 commit 8f4f13a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 5 deletions.
36 changes: 32 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,37 @@ 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
onMarketModeChanged: {
if (isAsk) quickscroll_timer.start()
}
onOrderbookChanged: {
if (isAsk) quickscroll_timer.start()
}
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

0 comments on commit 8f4f13a

Please sign in to comment.