Finding the maximum or adding Values are particularly for adjusting
margins for the safe area insets returned in app.UpdateEvent.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Invalidate is intended to be called as a result of external events,
which might very well be from a different goroutine than the one
driving the window.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Before this change MacroOp.Record simply reserved enough space for Stop to fill
out. If a user Record but never Stop'ed a MacroOp, the resulting Ops buffer
would end up with a zero, invalid opcode and panic at decode.
Fill out an empty MacroOp at Record, ensuring the Ops remains valid.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Since the main README recommends Go 1.13 or later, let's make the go.mod
files reflect that. This will enable starting to use new language
features.
Modules that still build on 1.12 will continue to work on that version
just fine; this line is just a hint to enable new language features for
versions of Go new enough.
Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Distance was meant to be used for implementing nested scrollers, but
I don't think the API is right. For example, Distance doesn't report
residual fling scrolling.
Delete the field while we wait for a better approach.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Inverted lists used to behave as if its top and bottom edges were
flipped. That was easy but also wrong: when the underlying children
changed size, they would move relative to the top edge of the list.
As illustrated by issue gio#34, Invert should only do two things:
- End lign lists smaller than the containing area.
- Scroll to end, but only as long as the user hasn't scrolled away.
List also had a bug where it didn't handle shrinking lists, so
this change rewrites List to fix that bug, fix Invert behaviour and
hopefully be a little simpler.
Fixes gio#34
Some platforms run on previous Go versions, but let's nudge people to use Go
1.13. Go 1.13 is required to build for WebAssembly and for running Go
binaries on the latest versions of Android, iOS, tvOS.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Apparently github.com/google/licenseclassifier/tools/identify_license
doesn't like that LICENSE is missing.
Merging the two separate license files makes one less file, and by adding the
SPDX identifier at the top I believe there is even less ambiguity that Gio
is covered by the UNLICENSE as well as the MIT license, as described in
the README.md file.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Including wayland-egl.h will also set WL_EGL_PLATFORM, but generic
egl code in egl_linux.go cannot do that.
For gio#35
Signed-off-by: Elias Naur <mail@eliasnaur.com>
A ToplevelClose event could end in the same batch of events as
another event, which will result in the other event being sent
after a DestroyEvent. Window assumes no event will arrive after
DestroyEvent, so ensure that property for the Wayland backend.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
First, vet was upset by two incorrect fmt verbs. One was an extra %x,
when there was just one argument, so remove it. Another was a %p with a
non-pointer. It's a struct, so for now simply use %#v.
Second, staticcheck found some unused or unnecessary bits of code;
remove the obvious ones.
Finally, staticcheck also complained about some error strings which were
capitalized or had periods. Adjust those, which also makes all error
messages more consistent.
Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
While we're here, split the usage print out to its own function and
don't display the usage when a package is missing.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
As pointed out by Daniel Martí, the replace line is convenient for
development but results in build differences depending on whether
you're inside or outside the gioui.org/apps module.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
With multiple GioViewControllers we might invoke the garbage collector
more than once, but in return we simplify the GioAppDelegate which will
become the interface to native widgets.
Signed-off-by: Elias Naur <mail@eliasnaur.com>