From 0117de71d3d72ab5c18ca1e29fd11aa264389c7b Mon Sep 17 00:00:00 2001 From: Pierre Curto Date: Mon, 20 Dec 2021 15:06:39 +0100 Subject: [PATCH] app: add String method to WindowMode and Orientation Signed-off-by: Pierre Curto --- app/os.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/app/os.go b/app/os.go index 81fb328d..fc5c266f 100644 --- a/app/os.go +++ b/app/os.go @@ -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). // // 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 { system.FrameEvent