ui/app: introduce Insets for system decoration insets

Insets is like image.Rectangle, but with properly named fields
and ui.Value instead of raw ints to make use with the layout
package easier.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-07-11 14:30:09 +02:00
parent 9d8d5da106
commit 478d56102a
3 changed files with 21 additions and 11 deletions
+8 -4
View File
@@ -19,16 +19,20 @@ type Event interface {
type DrawEvent struct {
Config Config
Size image.Point
// Insets is the window space taken up by
// system decoration such as translucent
// system bars and software keyboards.
Insets image.Rectangle
Insets Insets
// Whether this draw is system generated
// and needs a complete frame before
// proceeding.
sync bool
}
// Insets is the space taken up by
// system decoration such as translucent
// system bars and software keyboards.
type Insets struct {
Top, Bottom, Left, Right ui.Value
}
type StageEvent struct {
Stage Stage
}