Skip to content

Commit

Permalink
Fix bugs
Browse files Browse the repository at this point in the history
SetState1Icon should have been named SetOnStateIcon.
Rename state0.png and state1png to offstate.png and onstate.png to match Tapped test names.
  • Loading branch information
jimorc committed Oct 22, 2024
1 parent 60b932d commit 4bccdbd
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion widget/twostatetoolbaraction.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (t *TwoStateToolbarAction) SetOffStateIcon(icon fyne.Resource) {
}

// SetOnStateIcon sets the icon that is displayed when the state is OnState
func (t *TwoStateToolbarAction) SetState1Icon(icon fyne.Resource) {
func (t *TwoStateToolbarAction) SetOnStateIcon(icon fyne.Resource) {
t.onIcon = icon
t.setButtonIcon()
t.button.Refresh()
Expand Down
2 changes: 1 addition & 1 deletion widget/twostatetoolbaraction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,6 @@ func TestTwoStateToolbarAction_SetOnStateIcon(t *testing.T) {
w := test.NewWindow(tb)
defer w.Close()

action.SetOffStateIcon(theme.MediaPauseIcon())
action.SetOnStateIcon(theme.MediaPauseIcon())
assert.Equal(t, theme.MediaPauseIcon().Name(), action.onIcon.Name())
}

0 comments on commit 4bccdbd

Please sign in to comment.