pub fn draw_icon_button(
rect: Rect,
icon: IconId,
tint: Color,
style: IconButtonStyle,
) -> Vec<DrawCmd>👎Deprecated: use Button::new().child(Icon::new(…)) instead
Expand description
Produces the background and icon commands for a legacy icon button.
The first command fills rect; the second draws a square icon at
(rect.x + padding, rect.y + padding). This function only paints the
control: it provides no hit testing, focus handling, or click action.
§Examples
#![allow(deprecated)]
use ailloli_ui_core::{Color, IconId, Rect};
use ailloli_ui_widgets::controls::{draw_icon_button, IconButtonStyle};
let commands = draw_icon_button(
Rect::new(0.0, 0.0, 28.0, 28.0),
IconId::Check,
Color::WHITE,
IconButtonStyle::default(),
);
assert_eq!(commands.len(), 2);