Open petergeneric opened 1 year ago
This is not possible unfortunately. It is better for you to preserve the aspect ratio in HTML/CSS.
Reopening since this seems to be possible as far as i can see. I'd probably go with a similar setting to electron over a preserveAspectRatio but well see i guess.
Good to hear, although I'm going to unsubscribe from this ticket... frankly, with the outright rejection of this (pretty common native windowing feature, we gave up on Tauri as a project.
Describe the problem
Currently, tauri.conf.json allows setting window width/height and maxWidth/maxHeight. It is also possible to disable resize.
It isn't possible to preserve the initial aspect ratio, however. This is important for apps whose main window will scale as the window resizes, but where the app does not wish to support different aspect ratios (e.g. a 3x3 security camera grid)
Describe the solution you'd like
A new key in tauri.config.json's
WindowConfig
,preserveAspectRatio
, aboolean
defaulting tofalse
. If set totrue
, then when the user resizes the window, the aspect ratio of the initial window size (as defined in thewidth
andheight
keys) would be preserved.Alternatives considered
No response
Additional context
In Electron, this is achieved with: