pub fn draw_tabs_bar_with_options<T: TabsItem>(
rect: Rect,
tabs: &[T],
can_create_path_tab: bool,
style: TabsStyle,
text: &mut TextSystem,
options: TabsBarOptions,
) -> (Vec<DrawCmd>, TabsLayout)Expand description
Draws a tab bar and returns matching hit geometry.
The helper does not clip commands or process events. With trailing actions
visible it reserves two 28-pixel buttons plus a 6-pixel gap. Close hit rects
remain in tab_rects even when their x labels are hidden. An empty title
paints as "Conversation"; unread and processing share one status dot.
ยงExamples
use ailloli_ui_core::Rect;
use ailloli_ui_text::TextSystem;
use ailloli_ui_widgets::controls::{draw_tabs_bar_with_options, TabsBarOptions};
use ailloli_ui_widgets::controls::tabs::{TabsItem, TabsStyle};
struct Tab;
impl TabsItem for Tab {
fn id(&self) -> &str { "one" }
fn title(&self) -> &str { "" }
fn selected(&self) -> bool { false }
}
let options = TabsBarOptions { show_trailing_actions: false, ..TabsBarOptions::default() };
let mut text = TextSystem::new();
let (_, layout) = draw_tabs_bar_with_options(
Rect::new(0.0, 0.0, 240.0, 36.0), &[Tab], false, TabsStyle::default(), &mut text, options,
);
assert_eq!(layout.tab_rects.len(), 1);
assert_eq!(layout.controls.new_tab_rect.w, 0.0);