forked from fyne-io/fyne
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refresh dialog background on theme change
Fixes fyne-io#1201
- Loading branch information
1 parent
3d3694b
commit dcb72a1
Showing
5 changed files
with
55 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package dialog | ||
|
||
import ( | ||
"image/color" | ||
"testing" | ||
|
||
"fyne.io/fyne" | ||
"fyne.io/fyne/canvas" | ||
"fyne.io/fyne/test" | ||
"fyne.io/fyne/theme" | ||
"fyne.io/fyne/widget" | ||
) | ||
|
||
func TestShowCustom_ApplyTheme(t *testing.T) { | ||
a := test.NewApp() | ||
a.Settings().SetTheme(theme.DarkTheme()) | ||
w := test.NewWindow(canvas.NewRectangle(color.Transparent)) | ||
w.Resize(fyne.NewSize(300, 200)) | ||
d := NewCustom("Title", "OK", widget.NewLabel("Content"), w) | ||
|
||
d.Show() | ||
test.AssertImageMatches(t, "dialog-custom-dark.png", w.Canvas().Capture()) | ||
|
||
a.Settings().SetTheme(theme.LightTheme()) | ||
test.AssertImageMatches(t, "dialog-custom-light.png", w.Canvas().Capture()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.