Skip to main content

Module widgets

Module widgets 

Source
Available on crate feature egui only.
Expand description

Widgets are pieces of GUI such as Label, Button, Slider etc.

Example widget uses:

  • ui.add(Label::new("Text").text_color(color::red));
  • if ui.add(Button::new("Click me")).clicked() { … }

Modules§

color_picker
Color picker widgets.
text_edit

Structs§

Button
Clickable button with text.
Checkbox
Boolean on/off control with text label.
CompletionOutput
The result of CompletionPopup::show.
CompletionPopup
A code completion popup over a TextEdit.
CompletionQuery
What the CompletionPopup asks for suggestions for.
DragValue
A numeric value that you can change by dragging the number. More compact than a crate::Slider.
DragValueSettings
The editable numbers a slider shows beside its rail, one per handle.
FrameDurations
Stores the durations between each frame of an animated image
Hyperlink
A clickable hyperlink, e.g. to "https://github.com/emilk/egui".
Image
A widget which displays an image.
ImageOptions
ImageSize
This type determines the constraints on how the size of an image should be calculated.
Label
Static text.
Link
Clickable text, that looks like a hyperlink.
ProgressBar
A simple progress bar.
RadioButton
One out of several alternatives, either selected or not.
RangeSlider
Select a range of numbers with a two-handled slider.
Separator
A visual separator. A horizontal or vertical line (depending on crate::Layout).
Slider
Control a number with a slider.
SliderSpec
How values are spread along a slider’s rail.
Spinner
A spinner widget used to indicate loading.
Suggestion
One item in a CompletionPopup.
TextEdit
A text region that the user can edit the contents of.
ValueFormat
How a number is written, read back, and applied while being edited.

Enums§

ImageFit
This type determines how the image should try to fit within the UI.
ImageSource
This type tells the Ui how to load an image.
SliderClamping
Specifies how values in a Slider are clamped.
SliderOrientation
Specifies the orientation of a Slider.

Traits§

TextBuffer
Trait constraining what types crate::TextEdit may use as an underlying buffer.
Widget
Anything implementing Widget can be added to a Ui with Ui::add.
WidgetWithState
Helper so that you can do e.g. TextEdit::State::load.

Functions§

decode_animated_image_uri
Extracts uri and frame index
global_theme_preference_buttons
Show a row of buttons for changing the theme of the whole app.
global_theme_preference_switchDeprecated
Show a small button to switch to/from dark/light mode (globally).
has_gif_magic_header
Checks if bytes are gifs
has_webp_header
Checks if bytes are webp
paint_texture_at
reset_button
Show a button to reset a value to its default. The button is only enabled if the value does not already have its original value.
reset_button_with
Show a button to reset a value to its default. The button is only enabled if the value does not already have its original value.

Type Aliases§

BoxedWidget
A dynamically dispatched Widget.
NumFormatter
Formats a value for display, given the range of decimals it may show.
NumParser
Parses what the user typed, returning None if it is not a number.