diff --git a/v2/internal/ffenestri/ffenestri_darwin.go b/v2/internal/ffenestri/ffenestri_darwin.go index 6704aab22..460ac4a9a 100644 --- a/v2/internal/ffenestri/ffenestri_darwin.go +++ b/v2/internal/ffenestri/ffenestri_darwin.go @@ -15,31 +15,34 @@ import "C" func (a *Application) processPlatformSettings() { + mac := a.config.Mac + titlebar := mac.TitleBar + // HideTitle - if a.config.Mac.HideTitle { + if titlebar.HideTitle { C.HideTitle(a.app) } // HideTitleBar - if a.config.Mac.HideTitleBar { + if titlebar.HideTitleBar { C.HideTitleBar(a.app) } // Full Size Content - if a.config.Mac.FullSizeContent { + if titlebar.FullSizeContent { C.FullSizeContent(a.app) } // Toolbar - if a.config.Mac.UseToolbar { + if titlebar.UseToolbar { C.UseToolbar(a.app) } - if a.config.Mac.HideToolbarSeparator { + if titlebar.HideToolbarSeparator { C.HideToolbarSeparator(a.app) } - if a.config.Mac.TitlebarAppearsTransparent { + if titlebar.TitlebarAppearsTransparent { C.TitlebarAppearsTransparent(a.app) } diff --git a/v2/pkg/options/mac.go b/v2/pkg/options/mac/mac.go similarity index 54% rename from v2/pkg/options/mac.go rename to v2/pkg/options/mac/mac.go index 2ed5509c6..9124ac524 100644 --- a/v2/pkg/options/mac.go +++ b/v2/pkg/options/mac/mac.go @@ -1,7 +1,12 @@ -package options +package mac -// Mac ae options speific to Mas -type Mac struct { +// Options ae options speific to Mac +type Options struct { + TitleBar *TitleBar +} + +// TitleBar contains options for the Mac titlebar +type TitleBar struct { TitlebarAppearsTransparent bool HideTitle bool HideTitleBar bool diff --git a/v2/pkg/options/options.go b/v2/pkg/options/options.go index a77f2bea9..b65e991cf 100644 --- a/v2/pkg/options/options.go +++ b/v2/pkg/options/options.go @@ -1,5 +1,7 @@ package options +import "github.com/wailsapp/wails/v2/pkg/options/mac" + // App contains options for creating the App type App struct { Title string @@ -15,7 +17,7 @@ type App struct { StartHidden bool DevTools bool Colour int - Mac Mac + Mac *mac.Options } // MergeDefaults will set the minimum default values for an application diff --git a/v2/test/runtime/main.go b/v2/test/runtime/main.go index dc242ef79..9ed776106 100644 --- a/v2/test/runtime/main.go +++ b/v2/test/runtime/main.go @@ -3,6 +3,7 @@ package main import ( wails "github.com/wailsapp/wails/v2" "github.com/wailsapp/wails/v2/pkg/options" + "github.com/wailsapp/wails/v2/pkg/options/mac" ) type Echo struct { @@ -22,13 +23,15 @@ func main() { DisableResize: false, Fullscreen: false, Colour: 0xFF000088, - Mac: options.Mac{ - HideTitle: false, - HideTitleBar: false, - TitlebarAppearsTransparent: true, - FullSizeContent: false, - UseToolbar: true, - HideToolbarSeparator: true, + Mac: &mac.Options{ + TitleBar: &mac.TitleBar{ + HideTitle: false, + HideTitleBar: false, + TitlebarAppearsTransparent: true, + FullSizeContent: false, + UseToolbar: true, + HideToolbarSeparator: true, + }, }, })