Skip to content

Commit

Permalink
fix balance spacing and transactions alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
oshorefueled committed Jan 6, 2020
1 parent 9aefd2d commit 435d039
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
10 changes: 5 additions & 5 deletions fyne/pages/handler/overview.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,11 +372,11 @@ func newTransactionRow(transactionType, amount, fee, direction, status, date str
icon := canvas.NewImageFromResource(icons[transactionType])
icon.SetMinSize(fyne.NewSize(5, 20))
iconBox := widget.NewVBox(widgets.NewVSpacer(4), icon)
amountLabel := widget.NewLabel(amount)
feeLabel := widget.NewLabel(fee)
dateLabel := widget.NewLabel(date)
statusLabel := widget.NewLabel(status)
directionLabel := widget.NewLabel(direction)
amountLabel := widget.NewLabelWithStyle(amount, fyne.TextAlignTrailing, fyne.TextStyle{})
feeLabel := widget.NewLabelWithStyle(fee, fyne.TextAlignCenter, fyne.TextStyle{})
dateLabel := widget.NewLabelWithStyle(date, fyne.TextAlignCenter, fyne.TextStyle{})
statusLabel := widget.NewLabelWithStyle(status, fyne.TextAlignCenter, fyne.TextStyle{})
directionLabel := widget.NewLabelWithStyle(direction, fyne.TextAlignCenter, fyne.TextStyle{})
column := widget.NewHBox(iconBox, amountLabel, feeLabel, directionLabel, statusLabel, dateLabel)
return column
}
Expand Down
2 changes: 2 additions & 0 deletions fyne/pages/handler/values/dimensions.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ const (

TextSize10 = 10
TextSize12 = 12
TextSize15 = 15
TextSize16 = 16
TextSize14 = 14
TextSize24 = 24
TextSize25 = 25
TextSize20 = 20
TextSize32 = 32
ConfirmationButtonTextSize = 18
Expand Down
10 changes: 5 additions & 5 deletions fyne/pages/overview.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fyne.io/fyne/layout"
"fyne.io/fyne/widget"
"github.com/raedahgroup/dcrlibwallet"
"github.com/raedahgroup/godcr/fyne/layouts"
"github.com/raedahgroup/godcr/fyne/pages/handler"
"github.com/raedahgroup/godcr/fyne/pages/handler/values"
"github.com/raedahgroup/godcr/fyne/widgets"
Expand Down Expand Up @@ -72,7 +73,7 @@ func (ov *overview) recentTransactionBox() fyne.CanvasObject {
table.NewTable(overviewHandler.TableHeader)
overviewHandler.Table = table
overviewHandler.UpdateTransactions(ov.multiWallet, handler.TransactionUpdate{})
transactionsContainer := fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(515, 200)), table.Container)
transactionsContainer := fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(518, 200)), table.Container)
overviewHandler.TransactionsContainer = transactionsContainer

return widget.NewVBox(
Expand Down Expand Up @@ -177,13 +178,12 @@ func title() fyne.CanvasObject {
}

func balance() fyne.CanvasObject {
dcrBalance := widgets.NewLargeText("0.00", color.Black)
dcrDecimals := widgets.NewSmallText("00000 DCR", color.Black)
dcrBalance := widgets.NewTextWithStyle("0.00", color.Black, fyne.TextStyle{}, fyne.TextAlignLeading, values.TextSize25)
dcrDecimals := widgets.NewTextWithStyle("00000 DCR", color.Black, fyne.TextStyle{}, fyne.TextAlignLeading, values.TextSize15)
overviewHandler.Balance = make([]*canvas.Text, 2)
overviewHandler.Balance[0] = dcrBalance
overviewHandler.Balance[1] = dcrDecimals
decimalsBox := fyne.NewContainerWithLayout(layout.NewVBoxLayout(), widgets.NewVSpacer(6), dcrDecimals)
return widget.NewHBox(widgets.NewVSpacer(10), dcrBalance, decimalsBox)
return fyne.NewContainerWithLayout(layouts.NewHBox(0, true), dcrBalance, dcrDecimals)
}

func transactionRowHeader() *widget.Box {
Expand Down

0 comments on commit 435d039

Please sign in to comment.