Skip to content

Commit

Permalink
Use the new theme helper to avoid deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Feb 16, 2024
1 parent db86799 commit ca0e9e5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions container/tabs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package container
import (
"testing"

internalTest "fyne.io/fyne/v2/internal/test"
"github.com/stretchr/testify/assert"

"fyne.io/fyne/v2"
Expand All @@ -27,7 +28,7 @@ func TestTabButton_Icon_Change(t *testing.T) {
func TestTab_ThemeChange(t *testing.T) {
a := test.NewApp()
defer test.NewApp()
a.Settings().SetTheme(theme.LightTheme())
a.Settings().SetTheme(internalTest.LightTheme(theme.DefaultTheme()))

tabs := NewAppTabs(
NewTabItem("a", widget.NewLabel("a")),
Expand All @@ -37,12 +38,12 @@ func TestTab_ThemeChange(t *testing.T) {

initial := w.Canvas().Capture()

a.Settings().SetTheme(theme.DarkTheme())
a.Settings().SetTheme(internalTest.DarkTheme(theme.DefaultTheme()))
tabs.SelectIndex(1)
second := w.Canvas().Capture()
assert.NotEqual(t, initial, second)

a.Settings().SetTheme(theme.LightTheme())
a.Settings().SetTheme(internalTest.LightTheme(theme.DefaultTheme()))
tabs.SelectIndex(0)
assert.Equal(t, initial, w.Canvas().Capture())
}

0 comments on commit ca0e9e5

Please sign in to comment.