Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/gallery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ impl Gallery {
t,
&mut self.header_project_name,
&mut self.header_editing,
Some(("Sync live", true)),
);
ui.add_space(2.0);

Expand Down
8 changes: 8 additions & 0 deletions src/components.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1635,6 +1635,8 @@ pub struct AppHeaderActions {
/// `&mut is_editing` flag. Click the name to enter edit mode, Enter to commit
/// (returns `renamed: true`), Esc to cancel (caller restores the previous
/// name from its own copy if needed).
/// `status` optionally renders a shared chip beside the name; the boolean
/// selects its active/accent treatment.
///
/// The brand block paints the Tokito mark (via [`crate::brand_mark`]); the
/// mark itself carries the wordmark, so no system-font label is rendered.
Expand All @@ -1643,6 +1645,7 @@ pub fn app_header(
t: &Tokens,
project_name: &mut String,
is_editing: &mut bool,
status: Option<(&str, bool)>,
) -> AppHeaderActions {
let mut actions = AppHeaderActions::default();
let height = 52.0;
Expand Down Expand Up @@ -1698,6 +1701,11 @@ pub fn app_header(
}
}

if let Some((label, active)) = status {
ui.add_space(t.space_3);
let _ = chip(ui, t, label, active);
}

// Right side: settings gear.
ui.with_layout(Layout::right_to_left(Align::Center), |ui| {
if icon_button(ui, t, icons::ph::GEAR_SIX, 32.0, t.text_2).clicked() {
Expand Down
6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#![allow(unknown_lints)]
// egui's geometry APIs determine these literals as f32 unambiguously. Newer
// Rust releases warn on that established fallback under `-D warnings`, while
// Tokito still supports compilers from before the lint existed.
#![allow(float_literal_f32_fallback)]

//! # tokito_ui
//!
//! A small, opinionated component library for [`egui`] 0.29 — the shared
Expand Down
Loading