mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 09:55:40 +00:00
app: add String method to WindowMode and Orientation
Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
This commit is contained in:
@@ -81,6 +81,16 @@ func (m WindowMode) Option() Option {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m WindowMode) String() string {
|
||||||
|
switch m {
|
||||||
|
case Windowed:
|
||||||
|
return "windowed"
|
||||||
|
case Fullscreen:
|
||||||
|
return "fullscreen"
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
// Orientation is the orientation of the app (Orientation.Option sets it).
|
// Orientation is the orientation of the app (Orientation.Option sets it).
|
||||||
//
|
//
|
||||||
// Supported platforms are Android and JS.
|
// Supported platforms are Android and JS.
|
||||||
@@ -101,6 +111,18 @@ func (o Orientation) Option() Option {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (o Orientation) String() string {
|
||||||
|
switch o {
|
||||||
|
case AnyOrientation:
|
||||||
|
return "any"
|
||||||
|
case LandscapeOrientation:
|
||||||
|
return "landscape"
|
||||||
|
case PortraitOrientation:
|
||||||
|
return "portrait"
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
type frameEvent struct {
|
type frameEvent struct {
|
||||||
system.FrameEvent
|
system.FrameEvent
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user