pub enum UiEvent {
Show 35 variants
Click,
Changed(EventValue),
Submit,
Search(String),
FocusIn,
FocusOut,
WindowResized(Size),
WindowCloseRequested,
FullScreenChanged(bool),
MaximizedChanged(bool),
SidebarShownChanged(bool),
SidebarItemActivated(usize),
MetricsChanged,
Scrolled(Point),
RowShown(RowKey),
RowHidden(RowKey),
RowActivated(RowKey),
RowWidth(f32),
ViewportInsets(Insets),
ColumnWidths(Vec<f32>),
Pointer(PointerEvent),
Remeasure,
Custom(AnyValue),
ContextMenuItem(u32),
Hover(bool),
DoubleClick,
MenuItem(u32),
Key(Shortcut),
DropHover(bool),
FilesDropped(Vec<PathBuf>),
SurfaceReady(SurfaceHandle),
SurfaceResized(SurfaceSize),
SurfaceInput(SurfaceInput),
PointerLockEnded,
KeyboardGrabEnded,
}Expand description
Something that happened in the native UI.
Variants§
Click
Changed(EventValue)
The user changed a control’s value. The native widget already shows it.
Submit
Search(String)
A SearchInput asks for a search for its text, when the platform
does: as the user types (after a pause, where the platform waits for
one), on Return, and when the field is cleared. Not for text the
core set.
FocusIn
FocusOut
WindowResized(Size)
WindowCloseRequested
FullScreenChanged(bool)
The user put a window in full screen, or took it out (the title
bar’s button, the window manager’s key), or the platform did. Not
reported for the app’s own FullScreen. The core absorbs it as
FullScreen.
MaximizedChanged(bool)
The user maximized a window or restored it (the title bar’s button,
a double-click on it, the window manager’s key), or the platform
did. Not reported for the app’s own Maximized. The core absorbs
it as Maximized.
SidebarShownChanged(bool)
The user showed or hid a Sidebar (the platform’s own toggle, its
divider dragged away), or the platform did. Not reported for the
app’s own SidebarShown. The core absorbs it as SidebarShown.
SidebarItemActivated(usize)
A Sidebar’s item was activated, as a list’s row is (double-clicked,
or Enter pressed on it), where the platform’s sidebar has that: its
index across the sections.
MetricsChanged
Platform metrics changed (text size, color scheme, …).
Scrolled(Point)
A ScrollView’s or List’s scroll offset changed (by the user or
by ScrollTo).
RowShown(RowKey)
A List or Table realised a row: it’s in view, or about to be.
The core mounts the row and sends its host (a table’s: its cells’).
RowHidden(RowKey)
A List or Table let go of a row it had shown. The core disposes it.
RowActivated(RowKey)
A List’s or Table’s row was activated: double-clicked, or Enter
pressed on it.
RowWidth(f32)
The width a List gives its rows, when it isn’t the list’s own
width (scroll bars that take room from the rows, list insets). Rows
are laid out at that width.
ViewportInsets(Insets)
Where a ScrollView’s viewport is in its frame, when its scroll
bars or frame take room from its content (classic scroll bars, not
overlay ones). Its content is laid out in what’s left.
ColumnWidths(Vec<f32>)
The widths a Table’s columns give their cells, in column order:
once they’re known, and whenever they change (the user resized a
column, the table was resized). Cells are laid out at them.
Pointer(PointerEvent)
A pointer event on a drawn custom widget, in its coordinates.
Remeasure
A widget’s natural size changed on its own (an image finished loading); the core measures it again.
Custom(AnyValue)
An event of a custom widget or native view, of its own type.
ContextMenuItem(u32)
The item of the node’s context menu with this id was chosen.
Hover(bool)
The pointer came over a node that reports it (Prop::Hover), or
over anything inside it (true), or left it (false).
DoubleClick
A node that reports it (Prop::DoubleClick) was double-clicked.
MenuItem(u32)
The item of a MenuButton’s menu with this id was chosen.
Key(Shortcut)
A key the node takes (Prop::Keys) was pressed while it, or a
control inside it that doesn’t use the key, had keyboard focus.
DropHover(bool)
Files a node takes (Prop::FileDrop) are being dragged over it
(true), or no longer are: they left, or were dropped.
FilesDropped(Vec<PathBuf>)
Files and folders were dropped on a node: the ones it takes, in the order the platform gave them.
SurfaceReady(SurfaceHandle)
A GpuSurface’s native surface exists: the app can make its GPU
surface on it. Reported once, before any SurfaceResized; its size
may still be empty.
SurfaceResized(SurfaceSize)
A GpuSurface’s size in pixels, or its scale, changed.
SurfaceInput(SurfaceInput)
Keys or the pointer on a GpuSurface that takes input.
PointerLockEnded
The platform ended a GpuSurface’s pointer lock, or couldn’t make
it: its window stopped being the active one. The core absorbs it
as PointerLock(false).
KeyboardGrabEnded
The platform ended a GpuSurface’s keyboard grab, or couldn’t make
it: the surface lost focus, or its window stopped being the active
one. The core absorbs it as KeyboardGrab(false).