Commit Graph

12 Commits

Author SHA1 Message Date
Elias Naur 0b6dd4efd9 ui: change events to have "Event" suffixed, not prefixed
Match the Go error naming convention (FooError).

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-06-21 17:14:16 +02:00
Elias Naur 47c5859d87 ui/app: make Draw.Config a value, not a pointer
We are going to encourage a model where pointers to a central
(program global) Configs are passed to widgets at setup time, and
not pass Configs at every frame.

That way, the global Gonfig can change, but the pointers won't need
updating.

This change only switches the Draw event's Config pointer to a value
to avoid tempting programs to use the event Config instead of
updating their own central Configs.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-06-21 15:02:37 +02:00
Elias Naur a9199c6d23 ui/app: (android) relay system focus events
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-06-20 16:07:19 +02:00
Elias Naur e2a1f07b84 ui/app: rename StageVisible and StageInvisible
StageRunning and StagePaused better reflect their use.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-05-12 14:59:07 +02:00
Elias Naur 4441a3e13e Revert "ui/app,apps: unexport ChangeStage and Stage"
I found a convincing use case: stopping asynchronous activities
while paused. A follow up change will rename the stages and add
an example.

This reverts commit f9840b0963.
2019-05-12 14:47:38 +02:00
Elias Naur f9840b0963 ui/app,apps: unexport ChangeStage and Stage
I'm not convinced the API is right. For exmaple, an event that
notifies a program when to save its state is both smaller and
might be sufficient.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-05-11 13:50:18 +02:00
Elias Naur fc55c6ee5c ui/app: implement Command for system events
And add CommandBack for the Android back button.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-04-02 21:04:48 +02:00
Elias Naur ed2590e30e ui/app,apps/gophers,apps/hello: revert NewWindow to CreateWindow
It turns out we already support multiple windows on Android: when
the activity is recreated.

This reverts commit f21b5eb1df.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-04-02 19:54:37 +02:00
Elias Naur 48b6a73753 all: run goimports
gioui.org/ui was renamed from gioui.org/ui/ui before the release,
but the import order wasn't changed accordingly.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-04-02 17:09:06 +02:00
Elias Naur 1d67fad0c3 ui/app,apps/gophers,apps/hello: accept nil WindowOptions in NewWindow
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-03-31 13:59:06 +02:00
Elias Naur f21b5eb1df ui/app,apps/gophers,apps/hello: replace CreateWindow with NewWindow
Gio doesn't support multiple windows anyway, so get rid of the
app.Windows channel and use NewWindow call for the mobile platforms
as well.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-03-31 13:52:14 +02:00
Elias Naur 0f05231c35 all: initial import
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-03-31 10:47:22 +02:00