Skip to main content

draw_toggle_btn

Function draw_toggle_btn 

Source
pub fn draw_toggle_btn(
    ui: &mut Ui,
    icon: &Icon,
    tooltip: &'static str,
    is_toggled: bool,
    size: f32,
) -> Response
Expand description

Toggle button with icon (alias for draw_icon_btn since functionally identical).

Used for toggleable states like magnet mode, keep drawing, lock, etc.

§Arguments

  • ui - The egui UI context
  • icon - The Icon to display
  • tooltip - Hover tooltip text
  • is_toggled - Whether toggle is on
  • size - Button size (square)

§Returns

The egui Response for click handling.