For mixing native UI with Gio UI, the UIViewController is sometimes
needed, not just the UIView. This change replace the View field of
ViewEvent with ViewController.
Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
This patch adds internal Drag and Drop support to app.Windows.
The new package io/transfer adds the ability to
define draggable and droppable targets, which
are leveraged by the new widget.Draggable type.
The API is generic and could handle future use
cases, such as external Drag and Drop.
Updates gio#153
Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
When the Min constraints are set but the list
has no item to display, use those as the list
returned dimensions.
Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
Previous changes added semantic API and semantic information to Gio
widgets. This change maps the information to Android accessibility
classes so that TalkBack can traverse and interact with Gio programs.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Some semantic information is automatically extracted, but some must be
provided by UI components. This change enriches the generic and material
widgets with such information.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Software such as screen readers require semantic descriptions of user
interfaces to effectively present and interact with them. Package
semantic, combined with the existing package clip provide the operations
for Gio programs to describe themselves.
This change implements the semantic package and the routing changes for
accessing semantic trees; follow-ups add semantic information to widgets
and implement mapping semantic tree to platform representations.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Switch needs a semantic description, but doesn't have a text label
attached. This change adds a description argument to the constructor.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Icons have no inherent semantic meaning such as a label, so this change
adds another argument to the IconButton constructor for the client to
provide a description.
This is an API change, because it seems best to force every client to
provide semantic descriptions for icon buttons.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
To make the semantic relation between the enum widget and its content,
the content must be laid out inside the enum clip rect.
This is an API change. Users of Enum.Layout must provide a content
widget.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
To make the semantic relation between the editor and its content clear,
the editor clip operation must cover the content. This change adds an
explicit widget argument to editor, and lays it out inside the clip
rect.
This is an API change. Users of Editor.Layout must provide a content
widget.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
To make the semantic relation between the clickable area and its
content clear, it will be important for the clickable clip operation
to cover all of the clickable content.
API change: users of widget.Clickable must now pass the clickable
content to Layout.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
The click area was mistakenly offset by half the track width, but it
really should be offset by half the thumb diameter.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
A Path initialized with Begin should be ready to use with its pen at (0,
0). Make it so.
Updates gio#311
Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
Useful when drawing ellipses with Stroke.
Also, this makes it consistent with the other clip operations.
Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
The novulkan tag didn't completely disable the Vulkan backend, and
the backend wouldn't register on FreeBSD. This change fixes both
issues.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Commit 9835cd59 added support for the Window.Maximize and
Window.Center methods for Windows only.
This patch also adds support for macOS and X11.
Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
Before this patch, use of `app.Fullscreen` would result in "Failed to
find SetWindowLongPtrW procedure in user32.dll" when running on 32 bit
Windows.
Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
When the rectangle used in an Ellipse has no width
or height, the path would panic with "path not closed".
Use an empty rectangle path in that case instead.
Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
ViewEvent exposes native window handle for platform specific uses. This
change implements ViewEvent for iOS.
Fixes gio#305
Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
This change is a follow-up to bcf3ff77ff, fixing the two renderers to
properly render images with non-zero origins.
Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
On headless setups such as sr.ht CI machines, lavapipe is the only
available Vulkan driver. This change accepts the lavapipe software
driver for headless contexts, so that CI won't fall back to OpenGL.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Useful when drawing non-rounded rectangles with Stroke.
Also, this makes it consistent with RRect and Circle which
also have a Path method.
Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
Pointer hit areas and paint clip areas are separate concepts, but
similar enough to warrant merging. This change replaces pointer hit
areas with clip areas, so Gio is left with just one area concept (in
package op/clip).
The reason for separating the concepts in the original Gio release was
because of my being unsure general path/stroke hit areas would ever be
implemented, let alone efficient.
This change represents a change of mind, in the sense that it's better
to have an incomplete API than two separate area concepts.
Leave the deprecated pointer.Rect, pointer.Ellipse for temporary
backwards compatibility.
This is an API change. Most existing programs should continue to build
with this change, but may have to adjust to having all clip.Ops participate
in InputOp hit areas.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This comment and associated code were designed to guard against
the scrollbar failing to anchor to the proper edge of the content
when the layout.Direction was used with a zero minimum constraint.
However, they were in the wrong place to actually achieve the
desired behavior. This change simply moves the constraints
change to before the invocation of layout.Direction's Layout
method. This fixes the scrollbar appearing on the wrong edge of
content when the content is laid out with a zero minimum constraint.
Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
We're about to use clip.Ops for pointer areas; this change makes the
decoding accessible from the router package.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
We're about to make clip.Ops act as pointer areas, in which case we'd
like to contain the effect of PassOp to just pointer InputOps.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
op.Save, op.SaveStack were compatibility stop-gaps.
API change. Most op.Save/Loads can safely be removed altogether, or
replaced with
trans := op.Offset(f32.Pt(0, 0).Push(gtx.Ops)
...
trans.Pop()
cl := clip.Rect(image.Rect(-1e6, -1e6, 1e6, 1e6)).Push(gtx.Ops)
...
cl.Pop()
Signed-off-by: Elias Naur <mail@eliasnaur.com>
The Add method was a compatibility stop-gap.
API change. Use clip.Op.Push and Pop the return value to explicitly mark
the region affected by the clip operation.
Signed-off-by: Elias Naur <mail@eliasnaur.com>