mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 01:45:36 +00:00
app, app/internal: [wasm,android] new Option to set Orientation
Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
This commit is contained in:
+19
-1
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user