Skip to content

Commit

Permalink
Cleanup dex market page (#692)
Browse files Browse the repository at this point in the history
* fix dex order form

- Don't read feed channel from pg.selectedMarketOrderbook
- Remove unused code
- Calculate dex order by lot

Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com>

* rename quantity to amount on dex order form and use core.PreOrder for estimates

Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com>

* remove unused inflight order code

Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com>

---------

Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com>
  • Loading branch information
ukane-philemon authored Oct 22, 2024
1 parent 37e8a33 commit 8380273
Show file tree
Hide file tree
Showing 5 changed files with 154 additions and 207 deletions.
1 change: 1 addition & 0 deletions libwallet/dex_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@ type DEXClient interface {
WalletIDForAsset(assetID uint32) (*int, error)
MaxBuy(host string, base, quote uint32, rate uint64) (*core.MaxOrderEstimate, error)
MaxSell(host string, base, quote uint32) (*core.MaxOrderEstimate, error)
PreOrder(form *core.TradeForm) (*core.OrderEstimate, error)
Cancel(oid dex.Bytes) error
}
10 changes: 9 additions & 1 deletion ui/cryptomaterial/editor.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ func (e *Editor) FirstPressed(gtx C) bool {

}

func (e *Editor) IsFocused() bool {
return e.focused
}

func (e *Editor) SetFocus() {
e.isFirstFocus = true
}
Expand Down Expand Up @@ -289,8 +293,12 @@ func (e *Editor) layout(gtx C) D {

focused := gtx.Source.Focused(e.Editor)
if focused {
// Only non-read only editors should indicate an active state on focus.
if !e.Editor.ReadOnly {
e.LineColor = e.t.Color.Primary
}
e.TitleLabel.Color = e.t.Color.Primary
e.TitleLabel.Text = e.Hint
e.TitleLabel.Color, e.LineColor = e.t.Color.Primary, e.t.Color.Primary
if !e.showHintOnFocus {
e.Hint = ""
}
Expand Down
Loading

0 comments on commit 8380273

Please sign in to comment.