Skip to content

Commit

Permalink
move warning to avoid overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
smk762 committed Apr 6, 2024
1 parent 2bd2120 commit 98dde1b
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 60 deletions.
115 changes: 58 additions & 57 deletions atomic_defi_design/Dex/Exchange/Trade/ConfirmTradeModal.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ MultipageModal
titleAlignment: Qt.AlignHCenter
titleTopMargin: 0
topMarginAfterTitle: 10
flickMax: window.height - 430
flickMax: window.height - 385

header: [
RowLayout
Expand Down Expand Up @@ -77,62 +77,6 @@ MultipageModal
{
id: price_line
Layout.fillWidth: true
},

ColumnLayout
{
id: warnings_text
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter

// Large margin warning
FloatingBackground
{
Layout.alignment: Qt.AlignCenter
width: childrenRect.width
height: childrenRect.height
color: Style.colorRed2
visible: Math.abs(parseFloat(API.app.trading_pg.cex_price_diff)) >= 50

RowLayout
{
Layout.fillWidth: true

Item { width: 3 }

DefaultCheckBox
{
id: allow_bad_trade
Layout.alignment: Qt.AlignCenter
textColor: Style.colorWhite0
visible: Math.abs(parseFloat(API.app.trading_pg.cex_price_diff)) >= 50
spacing: 2
boxWidth: 16
boxHeight: 16
boxRadius: 8
label.wrapMode: Label.NoWrap
text: qsTr("Trade price is more than 50% different to CEX! Confirm?")
font: DexTypo.caption
}
}
}

DefaultText
{
Layout.alignment: Qt.AlignHCenter
text_value: qsTr("This swap request can not be undone and is a final event!")
font: DexTypo.italic12
color: Dex.CurrentTheme.foregroundColor2
}

DefaultText
{
id: warnings_tx_time_text
Layout.alignment: Qt.AlignHCenter
text_value: qsTr("This transaction can take up to 60 mins - DO NOT close this application!")
font: DexTypo.italic12
color: Dex.CurrentTheme.foregroundColor2
}
}
]

Expand Down Expand Up @@ -244,6 +188,38 @@ MultipageModal
}
}

// Large margin warning
FloatingBackground
{
Layout.alignment: Qt.AlignCenter
width: childrenRect.width
height: childrenRect.height
color: Style.colorRed2
visible: Math.abs(parseFloat(API.app.trading_pg.cex_price_diff)) >= 50

RowLayout
{
Layout.fillWidth: true

Item { width: 3 }

DefaultCheckBox
{
id: allow_bad_trade
Layout.alignment: Qt.AlignCenter
textColor: Style.colorWhite0
visible: Math.abs(parseFloat(API.app.trading_pg.cex_price_diff)) >= 50
spacing: 2
boxWidth: 16
boxHeight: 16
boxRadius: 8
label.wrapMode: Label.NoWrap
text: qsTr("Trade price is more than 50% different to CEX! Confirm?")
font: DexTypo.caption
}
}
}

// Custom config section
Item
{
Expand Down Expand Up @@ -416,6 +392,31 @@ MultipageModal
}
}

ColumnLayout
{
id: warnings_text
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter


DefaultText
{
Layout.alignment: Qt.AlignHCenter
text_value: qsTr("This swap request can not be undone and is a final event!")
font: DexTypo.italic12
color: Dex.CurrentTheme.foregroundColor2
}

DefaultText
{
id: warnings_tx_time_text
Layout.alignment: Qt.AlignHCenter
text_value: qsTr("This transaction can take up to 60 mins - DO NOT close this application!")
font: DexTypo.italic12
color: Dex.CurrentTheme.foregroundColor2
}
}

Item
{
visible: buy_sell_rpc_busy
Expand Down
6 changes: 3 additions & 3 deletions src/core/atomicdex/pages/widgets/dex/qt.orderbook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ namespace atomic_dex
void
qt_orderbook_wrapper::refresh_orderbook_model_data(mm2::orderbook_result_rpc answer)
{
SPDLOG_INFO("[qt_orderbook_wrapper::refresh_orderbook_model_data] bids/asks size: {}/{}", answer.bids.size(), answer.asks.size());
// SPDLOG_INFO("[qt_orderbook_wrapper::refresh_orderbook_model_data] bids/asks size: {}/{}", answer.bids.size(), answer.asks.size());
this->m_asks->refresh_orderbook_model_data(answer.asks);
this->m_bids->refresh_orderbook_model_data(answer.bids);
const auto data = this->m_system_manager.get_system<orderbook_scanner_service>().get_bestorders_data();
Expand All @@ -91,12 +91,12 @@ namespace atomic_dex
}
else if (m_best_orders->rowCount() == 0)
{
SPDLOG_INFO("[qt_orderbook_wrapper::refresh_orderbook_model_data] : reset_best_orders");
// SPDLOG_INFO("[qt_orderbook_wrapper::refresh_orderbook_model_data] : reset_best_orders");
m_best_orders->reset_orderbook(data, true);
}
else
{
SPDLOG_INFO("[qt_orderbook_wrapper::refresh_orderbook_model_data] : refresh_best_orders");
// SPDLOG_INFO("[qt_orderbook_wrapper::refresh_orderbook_model_data] : refresh_best_orders");
m_best_orders->refresh_orderbook_model_data(data, true);
}
this->set_both_taker_vol();
Expand Down

0 comments on commit 98dde1b

Please sign in to comment.