The new compute backend shares drawOps but not GPU.Collect. This
change moves the common path cache code to drawOps.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Currently, on iOS, the keyboard can block the content since it doesn't
trigger the "resize". Now, the `insets` will provide the size of the
keyboard (on iOS) and scrollbars. It's compatible with the Android (and
desktop), but Chrome automatic resizes the windows, so the `Inset` will
be 0.
Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
The Mesa software OpenGL implementation strays enough from the
reference values that tests fail. Relax the tests to make them
pass again.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
The mesa surfaceless renderer doesn't support configs, but does
support EGL_KHR_no_config_context so no config is required. Don't
fail context creation in this setup.
With this change, the headless tests work on a headless linux with the
EGL_PLATFORM environment variable set to "surfaceless".
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Apparently, darwin/arm64 cgo doesn't match the types of YES and BOOL:
os_macos.go:235:40: cannot use _Ciconst_YES (type untyped int) as type _Ctype__Bool
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Remove padding from the sides of the Slider to align them with
other components.
However, since sliders still need to be used with fingers try to
enforce a minimum finger height, if there is sufficient room.
The sides don't need similar treatment since after grabbing it's
possible to move the finger beyond the touch area, without losing
interaction.
To not enforce finger size, the theme can be adjusted:
theme.FingerSize = unit.Px(0)
Signed-off-by: Egon Elbre <egonelbre@gmail.com>
Similar to the Android, which includes all .jar files into the .apk.
Now, the `gogio -target js` will include all `*_js.js` files
into the resulting `wasm.js`.
That change make possible to adds custom wasm-imports, which might
be used in future versions of Gio.
Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
Now, gogio can build the program for Windows, using the `-target
windows`.
It will build with `-H=windowsgui`, by default. Also, it can compile for
multiple platforms if specified using `-target` (e.g. `-target arm, 386,
amd64`), the executable will have the respective suffix (i.e.
`_386.exe`).
gogio will also attach (any) appicon.png as executable icon resource and
include some information about the file and supported operating system.
Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
Knowing whether a widget is being interacted with allows to implement
bi-directional updates without feedbacks.
Signed-off-by: Egon Elbre <egonelbre@gmail.com>
Previously, the keyboard is open by default, even without any focus.
Now, the keyboard will remain closed, until `.focus()` is called. That
change also prevents the keyboard from reopening immediately after blur.
Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
"provided under terms" is a better match to the UNLICENSE, which puts
the project in the public domain the fullest extent possible.
This is a wording update, not a change in licesing terms.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This CL introduces 2 new path builders:
- Outline which takes a PathSpec to be outlined
- Stroke which takes a PathSpec and a stroke style, to stroke a path.
typically, code like this:
var p clip.Path
...
p.Outline().Add(o)
should be replaced with:
var p clip.Path
...
clip.Outline{Path: p.End()}.Op().Add(o)
similarly, stroking should be modified from:
var p clip.Path
...
p.Stroke(width, clip.StrokeStyle{...}).Add(o)
to:
var p clip.Path
...
clip.Stroke{Path: p.End(), Style: clip.StrokeStyle{Width:...}}.Op().Add(o)
here are tentative 'rf' scripts (see rsc.io/rf for more details):
```
ex {
import "gioui.org/op";
import "gioui.org/op/clip";
var p clip.Path;
var o *op.Ops;
p.Outline().Add(o) -> clip.Outline{Path:p.End()}.Op().Add(o);
}
ex {
import "gioui.org/op";
import "gioui.org/op/clip";
var o *op.Ops;
var p clip.Path;
var sty clip.StrokeStyle;
var width float32;
p.Stroke(width, sty).Add(o) -> \
clip.Stroke{ \
Path:p.End(), \
Style: clip.StrokeStyle{ \
Width: width, \
}}.Op().Add(o);
}
```
Signed-off-by: Sebastien Binet <s@sbinet.org>
The example module is moving to git.sr.ht/~eliasnaur/gio-example.
We still need some main package for testing gogio, so update reference
to use the module path (gioui.org/example).
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This introduces a new material.Palette type that captures the color information
necessary to render a widget. This type is embedded in the material.Theme to
make it easier to swap to a different palette for part of the UI by reassinging
the Palette field.
Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
Commit gioui.org/commit/94d242d18c9245 broke Editor and Label clipping,
most visible for single-line Editors. Restore the correct clipping.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
The Editor will handle CTRL+C and CTRL+V. The CTRL+V will paste the
content on the Editor, and CTRL+C will copy all the Editor content.
Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
Previously, the only way to manipulate the clipboard (read or write) is
using the `app.Window`.
The new `clipboard.ReadOp` and `clipboard.WriteOp`makes possible to
read/write from the widget.
Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
Move the replacing to Editor.prepend to fix SetText, and replace with
space instead of nothing to keep lines separated even in single-line
Editors.
Signed-off-by: Elias Naur <mail@eliasnaur.com>