asticode/go-astilectron

Hide Top?

Closed this issue ยท 2 comments

Hey is it possible to hide this?
https://i.imgur.com/YaP4hE1.png

I believe you need to set this attribute to false.

Let me know how it goes

tl;dr

try also Frame attribute to false


Hi @Dontmindmes

If you want to hide the entire title bar, try to

new BrowserWindow({frame: false})

see new BrowserWindow([options]) permalink

frame boolean (optional) - Specify false to create a frameless window. Default is true.

details

	if w, err = a.NewWindow("index.html", // it will call atilectron.index.js.consts.eventNames.windowCmdCreate
		&astilectron.WindowOptions{  // ๐Ÿ‘ˆ json.windowOptions  see explain below
			Center: astikit.BoolPtr(true),
			Height: astikit.IntPtr(700),
			Width:  astikit.IntPtr(700),
			// Closable:       astikit.BoolPtr(false),
			Frame: astikit.BoolPtr(false),   // ๐Ÿ‘ˆ add this
		}); err != nil {
		l.Fatal(fmt.Errorf("main: new window failed: %w", err))
	}
  1. atilectron.index.js.consts.eventNames.windowCmdCreate -> windowCreate(json)
  2. windowCreate(json) -> new BrowserWindow(json.windowOptions) for example new BrowserWindow({frame: false})
  3. json.windowOptions define in the window.go : WindowOptions
  4. good thing is @asticode already define for us, so you can set a.NewWindow("", &astilectron.WindowOptions{Frame: astikit.BoolPtr(false)},); done!

see also

If this helps, please close the issue. Thanks!