Skip to content

Commit

Permalink
Merge pull request #2387 from KomodoPlatform/fade-simple-disabled
Browse files Browse the repository at this point in the history
Filter out disabled coins in simple mode
  • Loading branch information
smk762 authored Dec 13, 2023
2 parents 5682af9 + ae21bf0 commit 4ca0145
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 29 deletions.
8 changes: 4 additions & 4 deletions atomic_defi_design/Dex/Components/SetupPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ Item

leftPadding: 30
rightPadding: leftPadding
topPadding: leftPadding * 0.5
bottomPadding: topPadding
topPadding: 12
bottomPadding: 12
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter

background: DefaultRectangle
Expand All @@ -69,9 +69,9 @@ Item

DexLanguage
{
y: 52
y: 24
anchors.right: parent.right
anchors.rightMargin: 52
anchors.rightMargin: 24
width: 72
}

Expand Down
2 changes: 1 addition & 1 deletion atomic_defi_design/Dex/Exchange/Trade/SimpleView/Main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Item
Column
{
width: root.currentSubPage === subPages.Trade ? _simpleTrade.best ? 600 : 450 : 450
y: 80
y: 60
spacing: 30
anchors.horizontalCenter: parent.horizontalCenter

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,10 @@ DexListView
delegate: DexRectangle // Order Line
{
property bool _isCoinEnabled: Constants.API.app.portfolio_pg.global_cfg_mdl.get_coin_info(coin).is_enabled

property bool _hideDisabled: hide_disabled_coins_checkbox.checked
visible: _isCoinEnabled ? true : _hideDisabled ? false : true
height: _isCoinEnabled ? _rowHeight : _hideDisabled ? 0 : _rowHeight
width: _rowWidth
height: _rowHeight
radius: mouse_area.containsMouse ? 3 : 0
border.width: 0
colorAnimation: false
Expand Down Expand Up @@ -177,6 +178,7 @@ DexListView
Layout.preferredWidth: _tokenColumnSize - parent._iconWidth
text_value: coin
font.pixelSize: 14
opacity: !_isCoinEnabled? .3 : 1
}
}

Expand All @@ -186,6 +188,7 @@ DexListView
horizontalAlignment: Text.AlignRight
text_value: parseFloat(General.formatDouble(rel_max_volume, General.amountPrecision, true)).toFixed(8)
font.pixelSize: 14
opacity: !_isCoinEnabled? .3 : 1
}

DexLabel // Order Available Quantity In BASE
Expand All @@ -194,13 +197,15 @@ DexListView
horizontalAlignment: Text.AlignRight
text_value: parseFloat(General.formatDouble(base_max_volume, General.amountPrecision, true)).toFixed(8)
font.pixelSize: 14
opacity: !_isCoinEnabled? .3 : 1
}

DexLabel // Order Fiat Volume
{
Layout.preferredWidth: _fiatVolumeColumnSize
horizontalAlignment: Text.AlignRight
text_value: parseFloat(price_fiat).toFixed(2)+Constants.API.app.settings_pg.current_fiat_sign
opacity: !_isCoinEnabled? .3 : 1
}

DexLabel
Expand All @@ -209,6 +214,7 @@ DexListView
horizontalAlignment: Text.AlignRight
color: cex_rates=== "0" ? Qt.darker(DexTheme.foregroundColor) : parseFloat(cex_rates)>0? DexTheme.warningColor : DexTheme.okColor
text_value: cex_rates=== "0" ? "N/A" : parseFloat(cex_rates)>0? "+"+parseFloat(cex_rates).toFixed(2)+"%" : parseFloat(cex_rates).toFixed(2)+"%"
opacity: !_isCoinEnabled? .3 : 1
}

DexTooltip
Expand Down
54 changes: 41 additions & 13 deletions atomic_defi_design/Dex/Exchange/Trade/SimpleView/Trade.qml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ClipRRect // Trade Card
onSelectedOrderChanged:
{
if (typeof selectedOrder !== 'undefined' && selectedOrder.from_best_order) Constants.API.app.trading_pg.orderbook.select_best_order(selectedOrder.uuid)
else if (typeof selectedOrder !== 'undefined') Constants.API.app.trading_pg.preferred_order = selectedOrder
else if (typeof selectedOrder !== 'undefined') Constants.API.app.trading_pg.preffered_order = selectedOrder
else Constants.API.app.trading_pg.reset_order()
Constants.API.app.trading_pg.determine_fees()
}
Expand Down Expand Up @@ -735,7 +735,7 @@ ClipRRect // Trade Card
Item
{
height: 35
width: 150
width: 206
visible: coinSelectorSimplified.visible

SearchField
Expand All @@ -747,6 +747,7 @@ ClipRRect // Trade Card
forceFocus: true
textField.onTextChanged: _coinList.model.setFilterFixedString(textField.text)
Component.onDestruction: _coinList.model.setFilterFixedString("")
textField.placeholderText: qsTr("Search coins")
}
}

Expand Down Expand Up @@ -782,21 +783,48 @@ ClipRRect // Trade Card
Item
{
height: 45
width: 150
width: parent.width - 40
visible: bestOrderSimplified.visible && (_bestOrderList.count > 0 || _bestOrderSearchField.textField.text != "")

SearchField
{
id: _bestOrderSearchField
anchors.topMargin: 10
height: 35

RowLayout {
anchors.fill: parent
anchors.leftMargin: 20
forceFocus: true
textField.onTextChanged: Constants.API.app.trading_pg.orderbook.best_orders.proxy_mdl.setFilterFixedString(textField.text)
Component.onDestruction: Constants.API.app.trading_pg.orderbook.best_orders.proxy_mdl.setFilterFixedString("")

SearchField
{

id: _bestOrderSearchField
Layout.alignment: Qt.AlignVCenter
Layout.preferredWidth: 206
Layout.preferredHeight: 35
Layout.leftMargin: 20
Layout.topMargin: 10
forceFocus: true
textField.onTextChanged: Constants.API.app.trading_pg.orderbook.best_orders.proxy_mdl.setFilterFixedString(textField.text)
Component.onDestruction: Constants.API.app.trading_pg.orderbook.best_orders.proxy_mdl.setFilterFixedString("")
textField.placeholderText: qsTr("Search coins")
}

Item {
Layout.fillWidth: true
}

DefaultCheckBox
{
id: hide_disabled_coins_checkbox
Layout.alignment: Qt.AlignVCenter
Layout.preferredHeight: 35
Layout.topMargin: 10

spacing: 2

label.wrapMode: Label.NoWrap
label.font.pixelSize: 14
text: qsTr("Show only enabled coins")
textColor: Dex.CurrentTheme.foregroundColor2
}
}
}


Item
{
Expand Down
6 changes: 3 additions & 3 deletions atomic_defi_design/Dex/Screens/Startup/Login.qml
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,20 @@ SetupPage
content: ColumnLayout
{
id: content
spacing: 10
spacing: 8

DexLabel
{
Layout.alignment: Qt.AlignHCenter
text: "%1 wallet".arg(walletName)
color: Dex.CurrentTheme.foregroundColor
font: DexTypo.body1
topPadding: 10
topPadding: 8
}

Item
{
height: 20
height: 16
width: 1
}

Expand Down
10 changes: 4 additions & 6 deletions atomic_defi_design/Dex/Screens/Startup/WalletsView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ SetupPage
signal walletSelected(string walletName);

image_path: Dex.CurrentTheme.bigLogoPath
image_margin: 15
image_margin: 12

backgroundColor: Dex.CurrentTheme.backgroundColor

content: ColumnLayout
{
id: content_column
width: 270
spacing: Style.rowSpacing
spacing: 8
RowLayout
{
Layout.fillWidth: true
Expand Down Expand Up @@ -115,7 +115,7 @@ SetupPage

width: content_column.width
Layout.minimumHeight: row_height
Layout.preferredHeight: (row_height * Math.min(wallet_count, 5)) + 20
Layout.preferredHeight: (row_height * Math.min(wallet_count, 4)) + 20
color: Dex.CurrentTheme.floatingBackgroundColor
radius: 18

Expand Down Expand Up @@ -294,10 +294,8 @@ SetupPage
{
Layout.alignment: Qt.AlignHCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: 20

anchors.bottomMargin: 0
anchors.horizontalCenter: parent.horizontalCenter

}

GaussianBlur
Expand Down

0 comments on commit 4ca0145

Please sign in to comment.