fyne-io / fyne

Cross platform GUI toolkit in Go inspired by Material Design
https://fyne.io/
Other
24.75k stars 1.37k forks source link

Minimum size of a window #5174

Closed MonaChanDev closed 3 hours ago

MonaChanDev commented 3 hours ago

Checklist

Is your feature request related to a problem?

Hi, I've just been using Fyne to build GUIs, but I immediately noticed that it's not possible to set a minimum size for the window.

I believe that this lack (or my ignorance) does not favor the correct use of the application by the user, since (as you can see from the photo attached below) it does not allow the window to be moved without resizing it first. Plus it doesn't show the window title

immagine

Using the Resize() function obviously apparently solves the problem, but the user can still resize the window as in the previous situation. To solve this problem, in my ignorance with this toolkit, I found myself having to set "\t\t\t\t\t\t\t\t\t\t\t\" inside a label , thus obtaining a very approximate minimum dimension, at least in width

Is it possible to construct a solution with the existing API?

No response

Describe the solution you'd like to see.

It would be convenient to find a similar function

w := a.NewWindow("ToDo", 800, 600)

Or

w.SetMinSize(800, 600)

You could also act on setting a minimum size for the containers instead of the window

andydotxyz commented 3 hours ago

Hi, I've just been using Fyne to build GUIs, but I immediately noticed that it's not possible to set a minimum size for the window.

The minimum size of a window is determined by the minimum size of the content inside it.

Using the Resize() function obviously apparently solves the problem

Yes, Window.Resize() is the correct way to ask the system to use more space than the minimum.

Why would you want the user to be disallowed from making the window as small as the content inside it allows? What happens on a smaller screen, or where the user wants to arrange their own desktop to fit as much on screen as possible?

andydotxyz commented 3 hours ago

(also note that Windows uses by far the most space for those buttons, so users on other systems won't agree with your assessment of "the correct use of the application by the user" because their system is not as "special" as windows.

MonaChanDev commented 3 hours ago

Why would you want the user to be disallowed from making the window as small as the content inside it allows?

The point is that conditions like these can be requested by the user himself (as in my case, although I understand that there are people who will not believe their ears). Furthermore, this could also damage the development of borderless windows for something more custom. If it is not possible to act directly on the window that is fine, but at least a minimum size is allowed for widgets and containers without using tricks such as tabulation

andydotxyz commented 1 hour ago

The point is that conditions like these can be requested by the user himself

I don't understand this sentence. What is being requested that we should disallow?

this could also damage the development of borderless windows

Well; we don't support borderless except the splash - I really don't see how these relate as a Borderless will respect the Window.Resize and also there are no border overlaps to worry about.