Skip to content

Commit

Permalink
update layout for slider on overview pag
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeBoy committed Dec 6, 2023
1 parent 4e7f738 commit 2307611
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions ui/cryptomaterial/segmented_control.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type SegmentedControl struct {
slideActionTitle *SlideAction
segmentType SegmentType

IsAllowsCycle bool
allowCycle bool
}

func (t *Theme) SegmentedControl(segmentTitles []string, segmentType SegmentType) *SegmentedControl {
Expand Down Expand Up @@ -248,7 +248,7 @@ func (sc *SegmentedControl) handleActionEvent(isNext bool) {
l := len(sc.segmentTitles) - 1 // index starts at 0
if isNext {
if sc.selectedIndex == l {
if !sc.IsAllowsCycle {
if !sc.allowCycle {
return
}
sc.selectedIndex = 0
Expand All @@ -259,7 +259,7 @@ func (sc *SegmentedControl) handleActionEvent(isNext bool) {
sc.slideActionTitle.PushLeft()
} else {
if sc.selectedIndex == 0 {
if !sc.IsAllowsCycle {
if !sc.allowCycle {
return
}
sc.selectedIndex = l
Expand Down
2 changes: 1 addition & 1 deletion ui/page/root/overview_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ func (pg *OverviewPage) assetBalanceItemLayout(item *assetBalanceSliderItem, row
return item.backgroundImage.LayoutSize2(gtx, gtx.Metric.PxToDp(width), gtx.Metric.PxToDp(height))
}),
layout.Expanded(func(gtx C) D {
return pg.contentSliderLayout(item)(gtx)
return layout.Center.Layout(gtx, pg.contentSliderLayout(item))
}),
)
})
Expand Down

0 comments on commit 2307611

Please sign in to comment.