LoginSignup
3
3

More than 5 years have passed since last update.

[Electron]ウィンドウの高さを制限する。

Posted at

Electronでアプリを作っていたら、
ウィンドウの高さを制限することの重要性に気づきましたので、
メモとして。

難しい話はないので、
そう、
ウィンドウオブジェクトを作る際に最低の高さを指定してあげるだけです。

const winSetting = { width: 800, height: 600, minHeight: 500}
const mainWindow = new BrowserWindow(winSetting)

これしないと、
ウィンドウサイズの
レイアウトが崩れてしまったりするので、
設定するかどうかは検討した方が良いと思います。

BrowserWindowのパラメータはここに載っています。
https://xwartz.gitbooks.io/electron-gitbook/content/en/api/browser-window.html#new-browserwindowoptions

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3