-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[v3] Add option for showing the toolbar in fullscreen mode on macOS (#…
…3282) * Add option for showing the toolbar in fullscreen mode on macOS * Add an example demonstrating the ShowToolbarWhenFullscreen option * Update docs * Add changelog entry * Run go mod tidy
- Loading branch information
Showing
9 changed files
with
113 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Show macOS Toolbar Example | ||
|
||
This example is a demonstration of the macOS option `ShowToolbarWhenFullscreen`, which keeps | ||
the system toolbar visible when in fullscreen mode. | ||
|
||
## Running the example | ||
|
||
To run the example (on macOS), simply run the following command: | ||
|
||
```bash | ||
go run . | ||
``` | ||
|
||
# Status | ||
|
||
| Platform | Status | | ||
|----------|---------| | ||
| Mac | Working | | ||
| Windows | N/A | | ||
| Linux | N/A | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package main | ||
|
||
import ( | ||
_ "embed" | ||
"log" | ||
|
||
"github.com/wailsapp/wails/v3/pkg/application" | ||
) | ||
|
||
func main() { | ||
app := application.New(application.Options{ | ||
Name: "Show macOS Toolbar", | ||
Description: "A demo of the ShowToolbarWhenFullscreen option", | ||
Mac: application.MacOptions{ | ||
ApplicationShouldTerminateAfterLastWindowClosed: true, | ||
}, | ||
}) | ||
|
||
// Create window | ||
app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{ | ||
Title: "Toolbar hidden (default behaviour)", | ||
HTML: "<html><body><h1>Switch this window to fullscreen: the toolbar will be hidden</h1></body></html>", | ||
CSS: `body { background-color: blue; color: white; height: 100vh; display: flex; justify-content: center; align-items: center; }`, | ||
Mac: application.MacWindow{ | ||
TitleBar: application.MacTitleBar{ | ||
UseToolbar: true, | ||
HideToolbarSeparator: true, | ||
}, | ||
}, | ||
}) | ||
|
||
// Create window | ||
app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{ | ||
Title: "Toolbar visible", | ||
HTML: "<html><body><h1>Switch this window to fullscreen: the toolbar will stay visible</h1></body></html>", | ||
CSS: `body { background-color: red; color: white; height: 100vh; display: flex; justify-content: center; align-items: center; }`, | ||
Mac: application.MacWindow{ | ||
TitleBar: application.MacTitleBar{ | ||
UseToolbar: true, | ||
HideToolbarSeparator: true, | ||
ShowToolbarWhenFullscreen: true, | ||
}, | ||
}, | ||
}) | ||
|
||
err := app.Run() | ||
|
||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters