diff --git a/v2/pkg/options/mac/mac.go b/v2/pkg/options/mac/mac.go index 9124ac52..dd365e65 100644 --- a/v2/pkg/options/mac/mac.go +++ b/v2/pkg/options/mac/mac.go @@ -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 -} diff --git a/v2/pkg/options/mac/titlebar.go b/v2/pkg/options/mac/titlebar.go new file mode 100644 index 00000000..b3ea31d1 --- /dev/null +++ b/v2/pkg/options/mac/titlebar.go @@ -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, + } +} diff --git a/v2/test/runtime/main.go b/v2/test/runtime/main.go index 9ed77610..5b9909eb 100644 --- a/v2/test/runtime/main.go +++ b/v2/test/runtime/main.go @@ -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(), }, })