Skip to content

Commit

Permalink
review changes
Browse files Browse the repository at this point in the history
Signed-off-by: Philemon Ukane <[email protected]>
  • Loading branch information
ukane-philemon committed Nov 27, 2023
1 parent 95375fd commit 6db823b
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 20 deletions.
7 changes: 4 additions & 3 deletions ui/page/dcrdex/market.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ var (
u8 = values.MarginPadding8
u300 = values.MarginPadding300
orderFormAndOrderBookWidth = (values.AppWidth / 2) - 40 // Minus 40 px to allow for margin between the order form and order book.
// orderFormAndOrderBookHeight is a constant height for the order form and
// orderbook. Use this to ensure they have the same height as they are
// displayed sided by side.
// orderFormAndOrderBookHeight is a an arbitrary height that accommodates
// the current order form elements and maxOrderDisplayedInOrderBook. Use
// this to ensure they(order form nad orderbook) have the same height as
// they are displayed sided by side.
orderFormAndOrderBookHeight = values.MarginPadding515

limitOrderIndex = 0
Expand Down
4 changes: 1 addition & 3 deletions ui/page/exchange/order_history_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,7 @@ func (pg *OrderHistoryPage) layout(gtx C) D {
Top: values.MarginPadding60,
}.Layout(gtx, pg.layoutHistory)
}),
layout.Expanded(func(gtx C) D {
return pg.statusDropdown.Layout(gtx)
}),
layout.Expanded(pg.statusDropdown.Layout),
)
})
}),
Expand Down
9 changes: 4 additions & 5 deletions ui/page/governance/consensus_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"gioui.org/font/gofont"
"gioui.org/io/clipboard"
"gioui.org/layout"
"gioui.org/unit"
"gioui.org/widget"
"gioui.org/widget/material"
"golang.org/x/text/cases"
Expand Down Expand Up @@ -81,9 +80,9 @@ func NewConsensusPage(l *load.Load) *ConsensusPage {
}, values.ConsensusDropdownGroup, 0, 10, true)

if pg.statusDropDown.Reversed() {
pg.statusDropDown.ExpandedLayoutInset.Right = unit.Dp(55)
pg.statusDropDown.ExpandedLayoutInset.Right = values.MarginPadding55
} else {
pg.statusDropDown.ExpandedLayoutInset.Left = unit.Dp(55)
pg.statusDropDown.ExpandedLayoutInset.Left = values.MarginPadding55
}

return pg
Expand Down Expand Up @@ -318,9 +317,9 @@ func (pg *ConsensusPage) layoutDesktop(gtx layout.Context) layout.Dimensions {
}),
layout.Expanded(func(gtx C) D {
if pg.statusDropDown.Reversed() {
pg.statusDropDown.ExpandedLayoutInset.Right = unit.Dp(10)
pg.statusDropDown.ExpandedLayoutInset.Right = values.MarginPadding10
} else {
pg.statusDropDown.ExpandedLayoutInset.Left = unit.Dp(10)
pg.statusDropDown.ExpandedLayoutInset.Left = values.MarginPadding10
}
return pg.statusDropDown.Layout(gtx)
}),
Expand Down
5 changes: 2 additions & 3 deletions ui/page/governance/proposals_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"time"

"gioui.org/layout"
"gioui.org/unit"
"gioui.org/widget"
"gioui.org/widget/material"

Expand Down Expand Up @@ -274,9 +273,9 @@ func (pg *ProposalsPage) layoutMobile(gtx layout.Context) layout.Dimensions {
}),
layout.Expanded(func(gtx C) D {
if pg.statusDropDown.Reversed() {
pg.statusDropDown.ExpandedLayoutInset.Right = unit.Dp(55)
pg.statusDropDown.ExpandedLayoutInset.Right = values.MarginPadding55
} else {
pg.statusDropDown.ExpandedLayoutInset.Left = unit.Dp(55)
pg.statusDropDown.ExpandedLayoutInset.Left = values.MarginPadding55
}
return pg.statusDropDown.Layout(gtx)
}),
Expand Down
8 changes: 2 additions & 6 deletions ui/page/transaction/transactions_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,7 @@ func (pg *TransactionsPage) layoutDesktop(gtx layout.Context) layout.Dimensions
})
})
}),
layout.Expanded(func(gtx C) D {
return pg.txTypeDropDown.Layout(gtx)
}),
layout.Expanded(pg.txTypeDropDown.Layout),
)
})
})
Expand Down Expand Up @@ -351,9 +349,7 @@ func (pg *TransactionsPage) layoutMobile(gtx layout.Context) layout.Dimensions {
})
}),
layout.Expanded(func(gtx C) D {
return layout.Inset{Right: values.MarginPadding10}.Layout(gtx, func(gtx C) D {
return pg.txTypeDropDown.Layout(gtx)
})
return layout.Inset{Right: values.MarginPadding10}.Layout(gtx, pg.txTypeDropDown.Layout)
}),
)
}),
Expand Down
1 change: 1 addition & 0 deletions ui/values/dimensions.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ var (
MarginPadding48 = unit.Dp(48)
MarginPadding50 = unit.Dp(50)
MarginPadding52 = unit.Dp(52)
MarginPadding55 = unit.Dp(55)
MarginPadding56 = unit.Dp(56)
MarginPadding60 = unit.Dp(60)
MarginPadding62 = unit.Dp(62)
Expand Down

0 comments on commit 6db823b

Please sign in to comment.