diff --git a/mkdocs-website/docs/favicon.ico b/mkdocs-website/docs/favicon.ico new file mode 100644 index 000000000..fb362effe Binary files /dev/null and b/mkdocs-website/docs/favicon.ico differ diff --git a/mkdocs-website/mkdocs.yml b/mkdocs-website/mkdocs.yml index 0dfebe14b..470df6f29 100644 --- a/mkdocs-website/mkdocs.yml +++ b/mkdocs-website/mkdocs.yml @@ -8,7 +8,7 @@ theme: logo: assets/images/wails-logo-horizontal-dark.svg icon: repo: fontawesome/brands/github - favicon: assets/images/favicon.svg + favicon: /favicon.ico features: - navigation.tabs - navigation.sections diff --git a/v3/pkg/application/options_webview_window.go b/v3/pkg/application/options_webview_window.go index 290fa7aa5..0686222de 100644 --- a/v3/pkg/application/options_webview_window.go +++ b/v3/pkg/application/options_webview_window.go @@ -10,38 +10,98 @@ const ( ) type WebviewWindowOptions struct { - Name string - Title string - Width int - Height int - AlwaysOnTop bool - URL string - DisableResize bool - Frameless bool - MinWidth int - MinHeight int - MaxWidth int - MaxHeight int - StartState WindowState - Centered bool - BackgroundType BackgroundType - BackgroundColour RGBA - HTML string - JS string - CSS string - X int - Y int - FullscreenButtonEnabled bool - Hidden bool - EnableFraudulentWebsiteWarnings bool - Zoom float64 - ZoomControlEnabled bool - EnableDragAndDrop bool - OpenInspectorOnStartup bool - Mac MacWindow - Windows WindowsWindow - Focused bool - Menu *Menu + // Name is a unique identifier that can be given to a window. + Name string + + // Title is the title of the window. + Title string + + // Width is the starting width of the window. + Width int + + // Height is the starting height of the window. + Height int + + // AlwaysOnTop will make the window float above other windows. + AlwaysOnTop bool + + // URL is the URL to load in the window. + URL string + + // DisableResize will disable the ability to resize the window. + DisableResize bool + + // Frameless will remove the window frame. + Frameless bool + + // MinWidth is the minimum width of the window. + MinWidth int + + // MinHeight is the minimum height of the window. + MinHeight int + + // MaxWidth is the maximum width of the window. + MaxWidth int + + // MaxHeight is the maximum height of the window. + MaxHeight int + + // StartState indicates the state of the window when it is first shown. + // Default: WindowStateNormal + StartState WindowState + + // Centered will center the window on the screen. + Centered bool + + // BackgroundType is the type of background to use for the window. + // Default: BackgroundTypeSolid + BackgroundType BackgroundType + + // BackgroundColour is the colour to use for the window background. + BackgroundColour RGBA + + // HTML is the HTML to load in the window. + HTML string + + // JS is the JavaScript to load in the window. + JS string + + // CSS is the CSS to load in the window. + CSS string + + // X is the starting X position of the window. + X int + + // Y is the starting Y position of the window. + Y int + + // TransparentTitlebar will make the titlebar transparent. + // TODO: Move to mac window options + FullscreenButtonEnabled bool + + // Hidden will hide the window when it is first created. + Hidden bool + + // Zoom is the zoom level of the window. + Zoom float64 + + // ZoomControlEnabled will enable the zoom control. + ZoomControlEnabled bool + + // EnableDragAndDrop will enable drag and drop. + EnableDragAndDrop bool + + // OpenInspectorOnStartup will open the inspector when the window is first shown. + OpenInspectorOnStartup bool + + // Mac options + Mac MacWindow + + // Windows options + Windows WindowsWindow + + // Focused indicates the window should be focused when initially shown + Focused bool // ShouldClose is called when the window is about to close. // Return true to allow the window to close, or false to prevent it from closing. diff --git a/v3/pkg/application/options_win.go b/v3/pkg/application/options_win.go index f5562a521..da75aa12d 100644 --- a/v3/pkg/application/options_win.go +++ b/v3/pkg/application/options_win.go @@ -85,6 +85,13 @@ type WindowsWindow struct { // EnableSwipeGestures enables swipe gestures for the window // Default: false EnableSwipeGestures bool + + // EnableFraudulentWebsiteWarnings will enable warnings for fraudulent websites. + // Default: false + EnableFraudulentWebsiteWarnings bool + + // Menu is the menu to use for the window. + Menu *Menu } type Theme int diff --git a/v3/pkg/application/webview_window_windows.go b/v3/pkg/application/webview_window_windows.go index f919e0178..81d686656 100644 --- a/v3/pkg/application/webview_window_windows.go +++ b/v3/pkg/application/webview_window_windows.go @@ -193,8 +193,8 @@ func (w *windowsWebviewWindow) run() { if !options.Windows.DisableMenu { theMenu := globalApplication.ApplicationMenu // Create the menu if we have one - if w.parent.options.Menu != nil { - theMenu = w.parent.options.Menu + if w.parent.options.Windows.Menu != nil { + theMenu = w.parent.options.Windows.Menu } if theMenu != nil { w.menu = NewApplicationMenu(w.hwnd, theMenu) @@ -1379,7 +1379,7 @@ func (w *windowsWebviewWindow) setupChromium() { disableFeatues := []string{} - if !w.parent.options.EnableFraudulentWebsiteWarnings { + if !opts.EnableFraudulentWebsiteWarnings { disableFeatues = append(disableFeatues, "msSmartScreenProtection") }