Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue where dialog shadows may not resize #1613

Merged
merged 2 commits into from Nov 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -14,6 +14,7 @@ More detailed release notes can be found on the [releases page](https://github.c
* [fyne-cli] Android: allow to specify an inline password for the keystore
* Fixed Card widget MinSize (#1581)
* Fix missing release tag to enable BuildRelease in Settings.BuildType()
* Dialog shadow does not resize after Refresh (#1370)


## 1.4.1 - 20 November 2020
Expand Down
4 changes: 2 additions & 2 deletions dialog/color.go
Expand Up @@ -21,7 +21,7 @@ type ColorPickerDialog struct {
Advanced bool
color color.Color
callback func(c color.Color)
advanced *widget.AccordionContainer
advanced *widget.Accordion
picker *colorAdvancedPicker
}

Expand Down Expand Up @@ -94,7 +94,7 @@ func (p *ColorPickerDialog) updateUI() {
p.picker = newColorAdvancedPicker(p.color, func(c color.Color) {
p.color = c
})
p.advanced = widget.NewAccordionContainer(widget.NewAccordionItem("Advanced", p.picker))
p.advanced = widget.NewAccordion(widget.NewAccordionItem("Advanced", p.picker))

p.dialog.content = fyne.NewContainerWithLayout(layout.NewVBoxLayout(),
fyne.NewContainerWithLayout(layout.NewCenterLayout(),
Expand Down
Binary file modified dialog/testdata/color/dialog_expanded_theme_dark.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dialog/testdata/color/dialog_expanded_theme_light.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions widget/popup.go
Expand Up @@ -232,7 +232,9 @@ type modalPopUpRenderer struct {

func (r *modalPopUpRenderer) Layout(canvasSize fyne.Size) {
padding := r.padding()
requestedSize := r.popUp.innerSize.Subtract(padding)
innerSize := r.popUp.innerSize.Max(r.popUp.Content.MinSize().Add(padding))

requestedSize := innerSize.Subtract(padding)
size := r.popUp.Content.MinSize().Max(requestedSize)
size = size.Min(canvasSize.Subtract(padding))
pos := fyne.NewPos((canvasSize.Width-size.Width)/2, (canvasSize.Height-size.Height)/2)
Expand All @@ -242,7 +244,7 @@ func (r *modalPopUpRenderer) Layout(canvasSize fyne.Size) {
innerPos := pos.Subtract(r.offset())
r.bg.Move(innerPos)
r.bg.Resize(size.Add(padding))
r.LayoutShadow(r.popUp.innerSize, innerPos)
r.LayoutShadow(innerSize, innerPos)
}

func (r *modalPopUpRenderer) MinSize() fyne.Size {
Expand Down