functora-egui 0.4.2

shadcn/ui-inspired widget library for egui - buttons, inputs, selects, dialogs, and 70+ more components with light/dark theming
Documentation
//! Show method for `StatusBar`.

impl super::widget::StatusBar {
    /// Renders a compact status bar and calls `content` inside it.
    pub fn show(self, ui: &mut egui::Ui, content: impl FnOnce(&mut egui::Ui)) -> egui::Response {
        let theme = crate::theme::shadcn_theme_ext::ShadcnThemeExt::shadcn_theme(ui.ctx());
        let margin = if self.dense {
            egui::Margin {
                left: 8,
                right: 8,
                top: 4,
                bottom: 4,
            }
        } else {
            egui::Margin {
                left: 10,
                right: 10,
                top: 6,
                bottom: 6,
            }
        };

        let frame = egui::Frame::NONE
            .fill(theme.muted)
            .inner_margin(margin)
            .corner_radius(crate::paint::corner_radius(theme.radius * 0.75))
            .stroke(egui::Stroke::new(1.0, theme.border));

        frame
            .show(ui, |inner_ui| {
                // Status bar items should stay single-line with truncation
                // for consistent row height when wrapping.
                inner_ui.style_mut().wrap_mode = Some(egui::TextWrapMode::Truncate);
                let _ = inner_ui.horizontal_wrapped(content);
            })
            .response
    }
}