app, app/internal: [wasm,android] new Option to set Orientation

Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
This commit is contained in:
Inkeliz
2021-04-23 18:21:58 +01:00
committed by Elias Naur
parent a06a7a4b3c
commit d51d8b46c3
5 changed files with 85 additions and 1 deletions
+19 -1
View File
@@ -464,13 +464,31 @@ var (
// windowMode sets the window mode.
//
// Supported platforms are macOS, X11 and Windows.
// Supported platforms are macOS, X11, Windows and JS.
func windowMode(mode wm.WindowMode) Option {
return func(opts *wm.Options) {
opts.WindowMode = &mode
}
}
var (
// AnyOrientation allows the window to be freely orientated.
AnyOrientation = orientation(wm.AnyOrientation)
// LandscapeOrientation constrains the window to landscape orientations.
LandscapeOrientation = orientation(wm.LandscapeOrientation)
// PortraitOrientation constrains the window to portrait orientations.
PortraitOrientation = orientation(wm.PortraitOrientation)
)
// orientation sets the orientation of the app.
//
// Supported platforms are Android and JS.
func orientation(mode wm.Orientation) Option {
return func(opts *wm.Options) {
opts.Orientation = &mode
}
}
// Title sets the title of the wm.
func Title(t string) Option {
return func(opts *wm.Options) {