Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeBoy committed Nov 21, 2023
1 parent f8b2c54 commit cacefb1
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions ui/cryptomaterial/segmented_control.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,8 @@ func (sc *SegmentedControl) Layout(gtx C, body func(gtx C) D) D {
layout.Rigid(func(gtx C) D {
if sc.segmentType == Group {
return sc.GroupTileLayout(gtx)
} else {
return sc.splitTileLayout(gtx)
}
return sc.splitTileLayout(gtx)
}),
layout.Rigid(func(gtx C) D {
return layout.Inset{Top: values.MarginPadding16}.Layout(gtx, func(gtx C) D {
Expand Down Expand Up @@ -228,22 +227,22 @@ func (sc *SegmentedControl) SetSelectedSegment(segment string) {
}
}

func (s *SegmentedControl) handleActionEvent(isNext bool) {
l := len(s.segmentTitles) - 1 // index starts at 0
func (sc *SegmentedControl) handleActionEvent(isNext bool) {
l := len(sc.segmentTitles) - 1 // index starts at 0
if isNext {
if s.selectedIndex == l {
s.selectedIndex = 0
if sc.selectedIndex == l {
sc.selectedIndex = 0
} else {
s.selectedIndex++
sc.selectedIndex++
}
s.sliceAction.PushLeft()
sc.sliceAction.PushLeft()
} else {
if s.selectedIndex == 0 {
s.selectedIndex = l
if sc.selectedIndex == 0 {
sc.selectedIndex = l
} else {
s.selectedIndex--
sc.selectedIndex--
}
s.sliceAction.PushRight()
sc.sliceAction.PushRight()
}
s.changed = true
sc.changed = true
}

0 comments on commit cacefb1

Please sign in to comment.