Skip to content

Commit

Permalink
scroll to selected tab on the single wallet main page
Browse files Browse the repository at this point in the history
  • Loading branch information
dreacot committed Oct 1, 2024
1 parent 3e397b6 commit 18af725
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ui/cryptomaterial/segmented_control.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ func (t *Theme) SegmentedControl(segmentTitles []string, segmentType SegmentType
sc.slideActionTitle.Draged(func(dragDirection SwipeDirection) {
isNext := dragDirection == SwipeRight
sc.handleActionEvent(isNext)
sc.list.ScrollTo(sc.selectedIndex)
})

return sc
Expand Down Expand Up @@ -452,3 +453,9 @@ func (sc *SegmentedControl) handleActionEvent(isNext bool) {
}
sc.changed = true
}

func (sc *SegmentedControl) ScrollTo(index int) {
sc.mu.Lock()
defer sc.mu.Unlock()
sc.list.ScrollTo(index)
}
1 change: 1 addition & 0 deletions ui/page/wallet/single_wallet_main_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ func (swmp *SingleWalletMasterPage) navigateToSelectedTab() {
}

swmp.activeTab[swmp.PageNavigationTab.SelectedSegment()] = pg.ID()
swmp.PageNavigationTab.ScrollTo(swmp.PageNavigationTab.SelectedIndex())

displayPage(pg)
}
Expand Down

0 comments on commit 18af725

Please sign in to comment.