Skip to content

Commit

Permalink
rebase and fix scroll bar in page used
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeBoy committed Oct 18, 2021
1 parent 06b594f commit 983a0c5
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 43 deletions.
4 changes: 2 additions & 2 deletions ui/page/proposal/proposals_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func (pg *ProposalsPage) Layout(gtx C) D {
)
}),
layout.Flexed(1, func(gtx C) D {
return components.UniformPadding(gtx, pg.layoutContent)
return layout.Inset{Top: values.MarginPadding24}.Layout(gtx, pg.layoutContent)
}),
)
}
Expand All @@ -309,7 +309,7 @@ func (pg *ProposalsPage) layoutProposalsList(gtx C) D {
proposalItems := pg.proposalItems
pg.proposalMu.Unlock()
return pg.proposalsList.Layout(gtx, len(proposalItems), func(gtx C, i int) D {
return layout.Inset{}.Layout(gtx, func(gtx C) D {
return components.UniformHorizontalPadding(gtx, func(gtx C) D {
return layout.Inset{
Top: values.MarginPadding2,
Bottom: values.MarginPadding2,
Expand Down
29 changes: 17 additions & 12 deletions ui/page/seedbackup/verify_seed.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package seedbackup

import (
"gioui.org/widget"
"gioui.org/widget/material"
"math/rand"
"strings"
"time"
Expand Down Expand Up @@ -33,6 +35,7 @@ type VerifySeedPage struct {
actionButton decredmaterial.Button
container *layout.List
seedList *layout.List
list *widget.List
}

func NewVerifySeedPage(l *load.Load, wallet *dcrlibwallet.Wallet, seed string) *VerifySeedPage {
Expand All @@ -45,6 +48,11 @@ func NewVerifySeedPage(l *load.Load, wallet *dcrlibwallet.Wallet, seed string) *
container: &layout.List{Axis: layout.Vertical},
seedList: &layout.List{Axis: layout.Vertical},
}
pg.list = &widget.List{
List: layout.List{
Axis: layout.Vertical,
},
}

pg.actionButton.Font.Weight = text.Medium

Expand Down Expand Up @@ -198,26 +206,23 @@ func (pg *VerifySeedPage) Layout(gtx C) D {
promptToExit(pg.Load)
},
Body: func(gtx C) D {
wdg := []layout.Widget{
func(gtx C) D {
return layout.Flex{Axis: layout.Vertical}.Layout(gtx,
layout.Rigid(func(gtx C) D {
label := pg.Theme.Label(values.TextSize16, "Select the correct words to verify.")
label.Color = pg.Theme.Color.Gray3
return label.Layout(gtx)
},
func(gtx C) D {
}),
layout.Rigid(func(gtx C) D {
return layout.Inset{
Bottom: values.MarginPadding96,
}.Layout(gtx, func(gtx C) D {
return pg.seedList.Layout(gtx, len(pg.multiSeedList), func(gtx C, index int) D {
return pg.seedListRow(gtx, index, pg.multiSeedList[index])
gtx.Constraints.Min.X = gtx.Constraints.Max.X
return material.List(pg.Theme.Base, pg.list).Layout(gtx, len(pg.multiSeedList), func(gtx C, i int) D {
return pg.seedListRow(gtx, i, pg.multiSeedList[i])
})
})
},
}

return pg.container.Layout(gtx, len(wdg), func(gtx C, index int) D {
return wdg[index](gtx)
})
}),
)
},
}

Expand Down
8 changes: 5 additions & 3 deletions ui/page/tickets/overview.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func (pg *Page) Layout(gtx layout.Context) layout.Dimensions {
widgets := []layout.Widget{
func(ctx layout.Context) layout.Dimensions {
return components.UniformHorizontalPadding(gtx, func(gtx layout.Context) layout.Dimensions {
return layout.Inset{Top: values.MarginPadding24}.Layout(gtx, pg.ticketPriceSection)
return pg.ticketPriceSection(gtx)
})
},
func(ctx layout.Context) layout.Dimensions {
Expand All @@ -159,8 +159,10 @@ func (pg *Page) Layout(gtx layout.Context) layout.Dimensions {
},
}
gtx.Constraints.Min.X = gtx.Constraints.Max.X
return material.List(pg.Theme.Base, pg.list).Layout(gtx, len(widgets), func(gtx C, i int) D {
return widgets[i](gtx)
return layout.Inset{Top: values.MarginPadding24}.Layout(gtx, func(gtx layout.Context) layout.Dimensions {
return material.List(pg.Theme.Base, pg.list).Layout(gtx, len(widgets), func(gtx C, i int) D {
return widgets[i](gtx)
})
})
}

Expand Down
1 change: 0 additions & 1 deletion ui/page/transaction_details_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ func NewTransactionDetailsPage(l *load.Load, transaction *dcrlibwallet.Transacti
}

pg.backButton, pg.infoButton = components.SubpageHeaderButtons(pg.Load)

pg.dot = decredmaterial.NewIcon(l.Icons.ImageBrightness1)
pg.dot.Color = l.Theme.Color.Gray

Expand Down
54 changes: 29 additions & 25 deletions ui/page/transactions_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,31 +126,35 @@ func (pg *TransactionsPage) Layout(gtx layout.Context) layout.Dimensions {
})
}

return pg.transactionList.Layout(gtx, len(wallTxs), func(gtx C, index int) D {
var row = components.TransactionRow{
Transaction: wallTxs[index],
Index: index,
ShowBadge: false,
}

return layout.Flex{Axis: layout.Vertical}.Layout(gtx,
layout.Rigid(func(gtx C) D {
return components.LayoutTransactionRow(gtx, pg.Load, row)
}),
layout.Rigid(func(gtx C) D {
// No divider for last row
if row.Index == len(wallTxs)-1 {
return layout.Dimensions{}
}

gtx.Constraints.Min.X = gtx.Constraints.Max.X
separator := pg.Theme.Separator()
return layout.E.Layout(gtx, func(gtx C) D {
// Show bottom divider for all rows except last
return layout.Inset{Left: values.MarginPadding56}.Layout(gtx, separator.Layout)
})
}),
)
return layout.Inset{Right: values.MarginPaddingMinus24}.Layout(gtx, func(gtx C) D {
return pg.transactionList.Layout(gtx, len(wallTxs), func(gtx C, index int) D {
var row = components.TransactionRow{
Transaction: wallTxs[index],
Index: index,
ShowBadge: false,
}

return layout.Inset{Right: values.MarginPadding24}.Layout(gtx, func(gtx C) D {
return layout.Flex{Axis: layout.Vertical}.Layout(gtx,
layout.Rigid(func(gtx C) D {
return components.LayoutTransactionRow(gtx, pg.Load, row)
}),
layout.Rigid(func(gtx C) D {
// No divider for last row
if row.Index == len(wallTxs)-1 {
return layout.Dimensions{}
}

gtx.Constraints.Min.X = gtx.Constraints.Max.X
separator := pg.Theme.Separator()
return layout.E.Layout(gtx, func(gtx C) D {
// Show bottom divider for all rows except last
return layout.Inset{Left: values.MarginPadding56}.Layout(gtx, separator.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 @@ -33,6 +33,7 @@ var (
MarginPadding22 = unit.Dp(22)
MarginPaddingMinus22 = unit.Dp(-22)
MarginPadding24 = unit.Dp(24)
MarginPaddingMinus24 = unit.Dp(-24)
MarginPadding25 = unit.Dp(25)
MarginPadding26 = unit.Dp(26)
MarginPadding30 = unit.Dp(30)
Expand Down

0 comments on commit 983a0c5

Please sign in to comment.