use eframe::egui;
pub const TOOLBAR_BTN: f32 = 28.0;
fn square() -> egui::Vec2 {
egui::vec2(TOOLBAR_BTN, TOOLBAR_BTN)
}
pub fn button(ui: &mut egui::Ui, glyph: &str, tooltip: &str) -> egui::Response {
ui.add(egui::Button::new(glyph).min_size(square()))
.on_hover_text(tooltip)
}
pub fn button_enabled(ui: &mut egui::Ui, enabled: bool, glyph: &str, tooltip: &str) -> egui::Response {
ui.add_enabled(enabled, egui::Button::new(glyph).min_size(square()))
.on_hover_text(tooltip)
}
pub fn toggle(ui: &mut egui::Ui, selected: bool, glyph: &str, tooltip: &str) -> egui::Response {
ui.add(egui::Button::new(glyph).min_size(square()).selected(selected))
.on_hover_text(tooltip)
}