Skip to content

Commit

Permalink
Make bootstrap front end public
Browse files Browse the repository at this point in the history
  • Loading branch information
genusistimelord committed Feb 13, 2024
1 parent 1da1198 commit 80f6ced
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions examples/tabs/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ enum Message {
#[allow(dead_code)]
Loaded(Result<(), String>),
FontLoaded(Result<(), font::Error>),
TabClosed(TabId),
}

async fn load() -> Result<(), String> {
Expand All @@ -91,6 +92,7 @@ impl Application for TabBarExample {
TabBarExample::Loading,
Command::batch(vec![
font::load(ICON_BYTES).map(Message::FontLoaded),
font::load(iced_aw::BOOTSTRAP_FONT_BYTES).map(Message::FontLoaded),
Command::perform(load(), Message::Loaded),
]),
)
Expand Down Expand Up @@ -119,6 +121,7 @@ impl Application for TabBarExample {
Message::Ferris(message) => state.ferris_tab.update(message),
Message::Counter(message) => state.counter_tab.update(message),
Message::Settings(message) => state.settings_tab.update(message),
Message::TabClosed(id) => println!("Tab {:?} event hit", id),
_ => {}
},
}
Expand Down Expand Up @@ -153,6 +156,7 @@ impl Application for TabBarExample {

Tabs::new(Message::TabSelected)
.tab_icon_position(iced_aw::tabs::Position::Bottom)
.on_close(Message::TabClosed)
.push(
TabId::Login,
state.login_tab.tab_label(),
Expand Down
10 changes: 9 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,15 @@ mod platform {
#[cfg(feature = "icons")]
pub use {
crate::graphics::icons::{nerd::NerdIcon, BootstrapIcon},
crate::graphics::icons::{BOOTSTRAP_FONT, NERD_FONT},
crate::graphics::icons::{
BOOTSTRAP_FONT, BOOTSTRAP_FONT_BYTES, NERD_FONT, NERD_FONT_BYTES,
},
};

#[cfg(not(feature = "icons"))]
pub use {
crate::graphics::icons::BootstrapIcon,
crate::graphics::icons::{BOOTSTRAP_FONT, BOOTSTRAP_FONT_BYTES},
};

#[doc(no_inline)]
Expand Down

0 comments on commit 80f6ced

Please sign in to comment.