mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 01:15:35 +00:00
app,io/system,layout: [API] move FrameEvent and Insets to package app
In the early days of Gio, FrameEvent was part of package app. It was moved to package system to enable layout.NewContext be a convenient short-hand for constructing a layout. However, it seems the better design to leave FrameEvent (and Insets) in package app, and move layout.NewContext there as well. More importantly, the move allows us to replace the event.Queue interface with a concrete type. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -6,9 +6,9 @@ import (
|
||||
"image"
|
||||
"testing"
|
||||
|
||||
"gioui.org/app"
|
||||
"gioui.org/io/key"
|
||||
"gioui.org/io/router"
|
||||
"gioui.org/io/system"
|
||||
"gioui.org/layout"
|
||||
"gioui.org/op"
|
||||
"gioui.org/widget"
|
||||
@@ -21,7 +21,7 @@ func TestClickable(t *testing.T) {
|
||||
b1 widget.Clickable
|
||||
b2 widget.Clickable
|
||||
)
|
||||
gtx := layout.NewContext(&ops, system.FrameEvent{Queue: &r})
|
||||
gtx := app.NewContext(&ops, app.FrameEvent{Queue: &r})
|
||||
layout := func() {
|
||||
b1.Layout(gtx, func(gtx layout.Context) layout.Dimensions {
|
||||
return layout.Dimensions{Size: image.Pt(100, 100)}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"gioui.org/io/system"
|
||||
"gioui.org/app"
|
||||
"gioui.org/layout"
|
||||
"gioui.org/op"
|
||||
"gioui.org/unit"
|
||||
@@ -15,7 +15,7 @@ import (
|
||||
|
||||
func TestListAnchorStrategies(t *testing.T) {
|
||||
var ops op.Ops
|
||||
gtx := layout.NewContext(&ops, system.FrameEvent{
|
||||
gtx := app.NewContext(&ops, app.FrameEvent{
|
||||
Metric: unit.Metric{
|
||||
PxPerDp: 1,
|
||||
PxPerSp: 1,
|
||||
|
||||
@@ -6,11 +6,11 @@ import (
|
||||
"image"
|
||||
"testing"
|
||||
|
||||
"gioui.org/app"
|
||||
"gioui.org/f32"
|
||||
"gioui.org/io/pointer"
|
||||
"gioui.org/io/router"
|
||||
"gioui.org/io/semantic"
|
||||
"gioui.org/io/system"
|
||||
"gioui.org/layout"
|
||||
"gioui.org/op"
|
||||
"gioui.org/widget"
|
||||
@@ -22,7 +22,7 @@ func TestBool(t *testing.T) {
|
||||
r router.Router
|
||||
b widget.Bool
|
||||
)
|
||||
gtx := layout.NewContext(&ops, system.FrameEvent{Queue: &r})
|
||||
gtx := app.NewContext(&ops, app.FrameEvent{Queue: &r})
|
||||
layout := func() {
|
||||
b.Layout(gtx, func(gtx layout.Context) layout.Dimensions {
|
||||
semantic.CheckBox.Add(gtx.Ops)
|
||||
|
||||
Reference in New Issue
Block a user