Support hidden titlebar

This commit is contained in:
Lea Anthony
2020-09-24 06:19:00 +10:00
parent ef11f45df8
commit e6addafcdd
3 changed files with 28 additions and 18 deletions

View File

@@ -4,13 +4,3 @@ package mac
type Options struct {
TitleBar *TitleBar
}
// TitleBar contains options for the Mac titlebar
type TitleBar struct {
TitlebarAppearsTransparent bool
HideTitle bool
HideTitleBar bool
FullSizeContent bool
UseToolbar bool
HideToolbarSeparator bool
}

View File

@@ -0,0 +1,27 @@
package mac
// TitleBar contains options for the Mac titlebar
type TitleBar struct {
TitlebarAppearsTransparent bool
HideTitle bool
HideTitleBar bool
FullSizeContent bool
UseToolbar bool
HideToolbarSeparator bool
}
// Credit: Comments from Electron site
// TitleBarHidden results in a hidden title bar and a full size content window,
// yet the title bar still has the standard window controls (“traffic lights”)
// in the top left.
func TitleBarHidden() *TitleBar {
return &TitleBar{
TitlebarAppearsTransparent: true,
HideTitle: true,
HideTitleBar: false,
FullSizeContent: true,
UseToolbar: false,
HideToolbarSeparator: false,
}
}

View File

@@ -24,14 +24,7 @@ func main() {
Fullscreen: false,
Colour: 0xFF000088,
Mac: &mac.Options{
TitleBar: &mac.TitleBar{
HideTitle: false,
HideTitleBar: false,
TitlebarAppearsTransparent: true,
FullSizeContent: false,
UseToolbar: true,
HideToolbarSeparator: true,
},
TitleBar: mac.TitleBarHidden(),
},
})