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

Feature Request: Constrain window width, but not window height. #138

Closed
yiar opened this issue Jul 19, 2021 · 1 comment · Fixed by #759
Closed

Feature Request: Constrain window width, but not window height. #138

yiar opened this issue Jul 19, 2021 · 1 comment · Fixed by #759

Comments

@yiar
Copy link

yiar commented Jul 19, 2021

See discussion including screenshots at Discord.

https://discord.com/channels/616186924390023171/625037620996734986/866688857139314729

"setting maxWidth breaks the vertical resizing" ... "also enforces the minHeight as its maxHeight"

My project need to be able to keep approximately the same width, but adjust height during runtime. E.g. like Apple Music for macOS does. It can be resized horizontally, but only up to a maxWidth. However height can be as high as you'd like.

@FabianLars
Copy link
Member

FabianLars commented Jul 19, 2021

Copy-pasting my message from discord:

There is still a bug tho i think.
If you set a maxWidth and a minHeight you get a window with maxWidth and a MAXHeight with the value of the minHeight.
If you then set a maxHeight it doesn't have visual consequences, but the vertical resizing stops working.
Try adding this to the api example (or whatever):

"maxWidth": 1000,
"minWidth": 10,
"minHeight": 100,
"maxHeight": 2000,
"resizable": true

Edit: apparently it was a bug at Tauri-level tauri-apps/tauri#2247

amrbashir added a commit that referenced this issue Jul 11, 2023
* feat: split min/max size constraints, closes #138

* windows impl

* linux impl

* fix linux impl

* cleanup linux impl

* macOS impl

* imports

* ios build

* macos build

* unsafe

* merge `set_min/max_width/height` into a single function

* fix macos build

* macos again

* use macros to generate DPI types

ref: rust-windowing/winit#2148

* fix windows impl

* fmt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants