Skip to content

Commit

Permalink
fixed examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Redhawk18 committed Nov 20, 2023
1 parent 61adb22 commit d452b47
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion examples/WidgetIDReturn/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl Application for NumberInputDemo {
(
NumberInputDemo::Loading,
Command::batch(vec![
font::load(iced_aw::graphics::icons::BOOTSTRAP_FONT).map(Message::FontLoaded),
font::load(iced_aw::graphics::icons::BOOTSTRAP_FONT_BYTES).map(Message::FontLoaded),
Command::perform(load(), Message::Loaded),
]),
)
Expand Down
2 changes: 1 addition & 1 deletion examples/card/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl Application for CardExample {
(
CardExample::Loading,
Command::batch(vec![
font::load(iced_aw::graphics::icons::BOOTSTRAP_FONT).map(Message::FontLoaded),
font::load(iced_aw::graphics::icons::BOOTSTRAP_FONT_BYTES).map(Message::FontLoaded),
Command::perform(load(), Message::Loaded),
]),
)
Expand Down
2 changes: 1 addition & 1 deletion examples/color_picker/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl Application for ColorPickerExample {
(
ColorPickerExample::Loading,
Command::batch(vec![
font::load(iced_aw::graphics::icons::BOOTSTRAP_FONT).map(Message::FontLoaded),
font::load(iced_aw::graphics::icons::BOOTSTRAP_FONT_BYTES).map(Message::FontLoaded),
Command::perform(load(), Message::Loaded),
]),
)
Expand Down
2 changes: 1 addition & 1 deletion examples/date_picker/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl Application for DatePickerExample {
(
DatePickerExample::Loading,
Command::batch(vec![
font::load(iced_aw::graphics::icons::BOOTSTRAP_FONT).map(Message::FontLoaded),
font::load(iced_aw::graphics::icons::BOOTSTRAP_FONT_BYTES).map(Message::FontLoaded),
Command::perform(load(), Message::Loaded),
]),
)
Expand Down
8 changes: 5 additions & 3 deletions examples/floating_element/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ use iced::{
Application, Command, Element, Length, Settings, Theme,

Check failure on line 6 in examples/floating_element/src/main.rs

View workflow job for this annotation

GitHub Actions / all

Diff in /home/runner/work/iced_aw/iced_aw/examples/floating_element/src/main.rs
};

use iced_aw::BootstrapIcon;
use iced_aw::floating_element::Anchor;
use iced_aw::{helpers::floating_element, Icon, BOOTSTRAP_FONT};
use iced_aw::graphics::icons::bootstrap::icon_to_string;
use iced_aw::{helpers::floating_element, BOOTSTRAP_FONT};

fn main() -> iced::Result {
FloatingElementExample::run(Settings::default())
Expand Down Expand Up @@ -45,7 +47,7 @@ impl Application for FloatingElementExample {
(
FloatingElementExample::Loading,
Command::batch(vec![
font::load(iced_aw::graphics::icons::BOOTSTRAP_FONT).map(Message::FontLoaded),
font::load(iced_aw::graphics::icons::BOOTSTRAP_FONT_BYTES).map(Message::FontLoaded),
Command::perform(load(), Message::Loaded),
]),
)
Expand Down Expand Up @@ -106,7 +108,7 @@ impl Application for FloatingElementExample {
.max_height(600)
.style(theme::Container::Box),
Button::new(
Text::new(Icon::Plus.to_string())
Text::new(icon_to_string(BootstrapIcon::Plus))
.font(BOOTSTRAP_FONT)
.size(35)
.line_height(1.0)
Expand Down
2 changes: 1 addition & 1 deletion examples/modal/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl Application for ModalExample {
(
ModalExample::Loading,
Command::batch(vec![
font::load(iced_aw::graphics::icons::BOOTSTRAP_FONT).map(Message::FontLoaded),
font::load(iced_aw::graphics::icons::BOOTSTRAP_FONT_BYTES).map(Message::FontLoaded),
Command::perform(load(), Message::Loaded),
]),
)
Expand Down
2 changes: 1 addition & 1 deletion examples/modal_component/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl Application for ModalExample {
(
ModalExample::Loading,
Command::batch(vec![
font::load(iced_aw::graphics::icons::BOOTSTRAP_FONT).map(Message::FontLoaded),
font::load(iced_aw::graphics::icons::BOOTSTRAP_FONT_BYTES).map(Message::FontLoaded),
Command::perform(load(), Message::Loaded),
]),
)
Expand Down
2 changes: 1 addition & 1 deletion examples/multiple_modals/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl Application for MultipleModalsExample {
state: State::Start,
button_pressed: None,
},
font::load(iced_aw::graphics::icons::BOOTSTRAP_FONT).map(Message::FontLoaded),
font::load(iced_aw::graphics::icons::BOOTSTRAP_FONT_BYTES).map(Message::FontLoaded),
)
}

Expand Down
2 changes: 1 addition & 1 deletion examples/number_input/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl Application for NumberInputDemo {
(
NumberInputDemo::Loading,
Command::batch(vec![
font::load(iced_aw::graphics::icons::BOOTSTRAP_FONT).map(Message::FontLoaded),
font::load(iced_aw::graphics::icons::BOOTSTRAP_FONT_BYTES).map(Message::FontLoaded),
Command::perform(load(), Message::Loaded),
]),
)
Expand Down
2 changes: 1 addition & 1 deletion examples/tab_bar/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl Application for TabBarExample {
(
TabBarExample::Loading,
Command::batch(vec![
font::load(iced_aw::graphics::icons::BOOTSTRAP_FONT).map(Message::FontLoaded),
font::load(iced_aw::graphics::icons::BOOTSTRAP_FONT_BYTES).map(Message::FontLoaded),
Command::perform(load(), Message::Loaded),
]),
)
Expand Down
8 changes: 4 additions & 4 deletions examples/tabs/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ use settings::{SettingsMessage, SettingsTab, TabBarPosition};

const HEADER_SIZE: u16 = 32;
const TAB_PADDING: u16 = 16;
const BOOTSTRAP_FONT: &[u8] = include_bytes!("../fonts/icons.ttf");
const BOOTSTRAP_FONT: Font = Font::with_name("icons");
const ICON_BYTES: &[u8] = include_bytes!("../fonts/icons.ttf");
const ICON: Font = Font::with_name("icons");

enum Icon {
User,
Expand Down Expand Up @@ -89,7 +89,7 @@ impl Application for TabBarExample {
(
TabBarExample::Loading,
Command::batch(vec![
font::load(BOOTSTRAP_FONT).map(Message::FontLoaded),
font::load(ICON_BYTES).map(Message::FontLoaded),
Command::perform(load(), Message::Loaded),
]),
)
Expand Down Expand Up @@ -173,7 +173,7 @@ impl Application for TabBarExample {
)
.set_active_tab(&state.active_tab)
.tab_bar_style(theme.clone())
.BOOTSTRAP_FONT(BOOTSTRAP_FONT)
.icon_font(ICON)
.tab_bar_position(match position {
TabBarPosition::Top => iced_aw::TabBarPosition::Top,
TabBarPosition::Bottom => iced_aw::TabBarPosition::Bottom,
Expand Down
2 changes: 1 addition & 1 deletion examples/time_picker/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl Application for TimePickerExample {
(
TimePickerExample::Loading,
Command::batch(vec![
font::load(iced_aw::graphics::icons::BOOTSTRAP_FONT).map(Message::FontLoaded),
font::load(iced_aw::graphics::icons::BOOTSTRAP_FONT_BYTES).map(Message::FontLoaded),
Command::perform(load(), Message::Loaded),
]),
)
Expand Down

0 comments on commit d452b47

Please sign in to comment.