Skip to content

Commit

Permalink
Fix oversight of SetDismissText before showing
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Mar 10, 2022
1 parent cd997be commit dfcb0ea
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
This file lists the main changes with each version of the Fyne toolkit.
More detailed release notes can be found on the [releases page](https://github.com/fyne-io/fyne/releases).

## 2.1.4 - Ongoing

* FolderOpenDialog SetDismissText is ineffective (#2830)

## 2.1.3 - 24 February 2021

### Fixed
Expand Down
1 change: 1 addition & 0 deletions dialog/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,7 @@ func (f *FileDialog) Hide() {

// SetDismissText allows custom text to be set in the confirmation button
func (f *FileDialog) SetDismissText(label string) {
f.dismissText = label
if f.dialog == nil {
return
}
Expand Down
4 changes: 4 additions & 0 deletions dialog/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ func TestView(t *testing.T) {
assert.Nil(t, reader)
}, win)

dlg.SetDismissText("Dismiss")
dlg.Show()

popup := win.Canvas().Overlays().Top().(*widget.PopUp)
Expand Down Expand Up @@ -470,6 +471,9 @@ func TestView(t *testing.T) {
// toggleViewButton should reflect to what it will do (change to a list view).
assert.Equal(t, "", toggleViewButton.Text)
assert.Equal(t, theme.ListIcon(), toggleViewButton.Icon)

dismiss := ui.Objects[2].(*fyne.Container).Objects[0].(*fyne.Container).Objects[0].(*widget.Button)
assert.Equal(t, "Dismiss", dismiss.Text)
}

func TestFileFavorites(t *testing.T) {
Expand Down

0 comments on commit dfcb0ea

Please sign in to comment.