setup: load Bootstrap Icons font so icons render in the wizard
Both run() and run_new() were starting with Task::none(), so the Bootstrap font was never loaded. All icon() calls in the setup wizard rendered as '?' glyphs. Load the font as the initial task (batched with AutoDownload where needed) and handle FontLoaded as a no-op. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+11
-3
@@ -41,6 +41,7 @@ pub enum Message {
|
||||
LaunchNow,
|
||||
Close,
|
||||
ToggleLog,
|
||||
FontLoaded,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
@@ -392,6 +393,7 @@ fn update(state: &mut State, message: Message) -> Task<Message> {
|
||||
iced::exit()
|
||||
}
|
||||
Message::Close => iced::exit(),
|
||||
Message::FontLoaded => Task::none(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -871,10 +873,12 @@ pub fn run(config: &Config, launcher: &Launcher) -> Result<()> {
|
||||
if has_url {
|
||||
state.source = launcher.installer_url.unwrap_or_default();
|
||||
}
|
||||
let load_font = iced::font::load(std::borrow::Cow::Borrowed(iced_fonts::BOOTSTRAP_FONT_BYTES))
|
||||
.map(|_| Message::FontLoaded);
|
||||
let init_task = if has_url {
|
||||
Task::done(Message::AutoDownload)
|
||||
Task::batch([load_font, Task::done(Message::AutoDownload)])
|
||||
} else {
|
||||
Task::none()
|
||||
load_font
|
||||
};
|
||||
(state, init_task)
|
||||
})
|
||||
@@ -891,7 +895,11 @@ pub fn run_new(config: &Config) -> Result<()> {
|
||||
resizable: false,
|
||||
..Default::default()
|
||||
})
|
||||
.run_with(move || (State::new_picking(config.clone()), Task::none()))
|
||||
.run_with(move || {
|
||||
let load_font = iced::font::load(std::borrow::Cow::Borrowed(iced_fonts::BOOTSTRAP_FONT_BYTES))
|
||||
.map(|_| Message::FontLoaded);
|
||||
(State::new_picking(config.clone()), load_font)
|
||||
})
|
||||
.map_err(|e| anyhow::anyhow!("iced: {e}"))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user