select only.Expand description
A dropdown for choosing one value from a list.
The select opens and closes its own list, so the app only handles the chosen value. The list floats on the shared anchored layer in the menu look, with a check mark on the selected option. Escape or a click outside closes it.
A long list shows MAX_VISIBLE_ROWS rows and scrolls, with a
scrollbar, and is never taller than the room the window has. It opens
with the selected option in the middle, and the highlight stays in view
as the keys move it. A list that fits looks as it always has.
An enabled select takes keyboard focus from iced’s focus operations, such as a dialog’s Tab order, and rings while focused. Space, Enter or ArrowDown then opens the list with the selected option highlighted. In the open list the arrow keys, Page Up, Page Down, Home and End move the highlight, Space or Enter chooses it and closes the list, and Tab closes it and moves on. Typing letters moves the highlight to the first option starting with them.
searchable adds a search field that filters the
options as you type, and on_custom lets the user
enter a value that is not in the list.
Re-exports§
Structs§
Enums§
- Action
- What a select keyboard shortcut does.
Constants§
- DEFAULT_
EMPTY - Shown when the search matches no option.
- DEFAULT_
NOT_ VALID - Shown when the app turns a typed value down.
- HEIGHT
- Height of the closed select in logical pixels.
- MAX_
VISIBLE_ ROWS - Rows the open list shows before it scrolls, unless
max_visible_rowssays otherwise. - NO_
OPTIONS - Shown in the open list of a select with no options.
- TYPE_
AHEAD_ PAUSE - How long a pause in typing starts a new type-ahead search.
Functions§
- default_
keymap - The default select shortcuts:
- select
- Creates a select over
options, showingselectedwhen it is set. Options are labelled with theirDisplaytext. - style
- The iced pick list style for a status.