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

Setting FixedSize smaller than window content gives inconsistent results #1154

Closed
ghost opened this issue Jul 1, 2020 · 5 comments
Closed
Milestone

Comments

@ghost
Copy link

ghost commented Jul 1, 2020

Describe the bug:

Setting both window size and making window to be FixedSize cause next behavior:

  • the window has size that was set
  • as soon as it's dragged it's resized to fit the content (it's still FixedSize)
    see code and screenshot below

To Reproduce:

Steps to reproduce the behavior:

  1. get develop branch with the Fix/1105 #1138 applied
  2. create simple application with the window and long text inside it
  3. resize it so the width is definitely not enough for the text
  4. set the window to be fixed size
  5. start it
  6. drag it

Screenshots:

image

on the image from the top to the bottom:

  1. resized and fixed size initially
  2. resized and fixed size after i dragged it a bit (same binary)
  3. resized and size is not fixed
  4. not resized, fixed size

Example code:

package main

import (
	"fyne.io/fyne"
	"fyne.io/fyne/app"
	"fyne.io/fyne/widget"
)

func main() {
	app := app.New()
	win := app.NewWindow("window title")
	win.Resize(fyne.NewSize(200, 100))
	win.SetFixedSize(true)

	win.SetContent(widget.NewHBox(
		widget.NewLabel("long text to exceed initial window width"),
	))
	win.ShowAndRun()
}

Device (please complete the following information):

  • OS: windoows
  • Version: 10.0.18363.900
  • Go version: 1.13.8 windows/amd64, 1.14.4 windows/amd64
  • C,CPP compiler: x86_64-w64-mingw32\9.3.0
  • Fyne version: 1.3. develop 102ff9e
@ghost
Copy link
Author

ghost commented Jul 1, 2020

reverting #1138 locally is giving width based on the window content

@andydotxyz andydotxyz added this to the 1.3.x milestone Jul 1, 2020
@ghost
Copy link
Author

ghost commented Jul 7, 2020

can't reproduce on current develop 75cf469
maybe because of #1162
the window width is autosized from the start

@andydotxyz
Copy link
Member

Oh that would be nice. Perhaps you could test today’s 1.3.1 release and maybe we can close this :)

@ghost
Copy link
Author

ghost commented Jul 8, 2020

Sure, i'll test.
The thing is the root cause is still there, there's no decision if auto-sizing should be done for fixed size window. On the other hand there are no complains so auto-sizing is probably what users are happy with.

@ghost
Copy link
Author

ghost commented Jul 8, 2020

Checked on 44606fb and i can confirm the old behavior is back.
Fixed size window resized to fit the content it explicitly set size is not enough.

@ghost ghost closed this as completed Jul 11, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant