Fix icons font not being loaded in main window

This commit is contained in:
Exidex 2025-06-19 14:21:15 +02:00
parent 2afecf3b80
commit 0d7a9db4d9
No known key found for this signature in database
GPG key ID: AC63AA86DD4F2D45
2 changed files with 2 additions and 8 deletions

View file

@ -218,7 +218,6 @@ pub enum AppMsg {
widget_event: ComponentWidgetEvent,
},
Noop,
FontLoaded(Result<(), font::Error>),
ShowWindow,
HideWindow,
ToggleWindow,
@ -482,6 +481,7 @@ fn run_non_wayland(minimized: bool) -> anyhow::Result<()> {
},
..Default::default()
})
.font(BOOTSTRAP_FONT_BYTES)
.subscription(subscription)
.theme(|state, _| state.theme.clone())
.run()?;
@ -529,7 +529,7 @@ fn new(#[cfg(target_os = "linux")] wayland: bool, minimized: bool) -> (AppModel,
let theme = GauntletComplexTheme::new(setup_data.theme);
GauntletComplexTheme::set_global(theme.clone());
let mut tasks = vec![font::load(BOOTSTRAP_FONT_BYTES).map(AppMsg::FontLoaded)];
let mut tasks = vec![];
#[cfg(target_os = "linux")]
let (main_window_id, open_task) = if wayland {
@ -1145,10 +1145,6 @@ fn update(state: &mut AppModel, message: AppMsg) -> Task<AppMsg> {
render_location,
} => state.handle_plugin_event(widget_event, plugin_id, render_location),
AppMsg::Noop => Task::none(),
AppMsg::FontLoaded(result) => {
result.expect("unable to load font");
Task::none()
}
AppMsg::ToggleWindow => state.toggle_window(),
AppMsg::ShowWindow => state.show_window(),
AppMsg::HideWindow => state.hide_window(true),

View file

@ -6,7 +6,6 @@ use iced::Pixels;
use iced::border::Radius;
use iced::keyboard::Modifiers;
use iced::widget::text;
use iced_fonts::BOOTSTRAP_FONT;
use iced_fonts::bootstrap::arrow_return_left;
use iced_fonts::bootstrap::command;
use iced_fonts::bootstrap::option;
@ -96,7 +95,6 @@ pub fn shortcut_to_text<'a, Message, Theme: text::Catalog + 'a>(
if cfg!(target_os = "macos") {
Some(
text("^") // TODO bootstrap doesn't have proper macos ctrl icon
.font(BOOTSTRAP_FONT) // todo replace
.into(),
)
} else {