From 29568a14b389049480591e67a116400d030e8db1 Mon Sep 17 00:00:00 2001 From: Vika Date: Thu, 30 Jan 2025 09:51:33 +0300 Subject: Provide an application icon --- src/lib.rs | 7 ++++++- src/main.rs | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lib.rs b/src/lib.rs index 111be23..9e7569f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,6 +3,10 @@ use adw::prelude::*; use libsecret::prelude::{RetrievableExtManual, RetrievableExt}; use relm4::{actions::{RelmAction, RelmActionGroup}, gtk, loading_widgets::LoadingWidgets, prelude::{AsyncComponent, AsyncComponentController, AsyncComponentParts, AsyncController, ComponentController, Controller}, AsyncComponentSender, Component, RelmWidgetExt}; +pub mod icons { + include!(concat!(env!("OUT_DIR"), "/icons.rs")); +} + pub mod components { pub(crate) mod smart_summary; #[cfg(feature = "smart-summary")] @@ -413,7 +417,7 @@ impl AsyncComponent for App { set_popover = >k::PopoverMenu::from_model(Some(&main_menu)) {}, #[watch] set_visible: model.micropub.is_some(), - set_icon_name: relm4_icons::icon_names::MENU, + set_icon_name: "menu", }, pack_end = >k::Button { set_icon_name: "document-send-symbolic", @@ -550,6 +554,7 @@ impl AsyncComponent for App { Input::SubmitButtonPressed => { if self.micropub.is_some() { self.submit_busy_guard = Some(relm4::main_adw_application().mark_busy()); + // TODO: too easy to deadlock here, refactor to take a channel self.post_editor.emit(PostEditorInput::Submit); }; }, diff --git a/src/main.rs b/src/main.rs index d7dd0a1..59b4bc0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,7 +14,7 @@ fn main() { log::set_logger(&GLIB_LOGGER).unwrap(); log::set_max_level(log::LevelFilter::Debug); - relm4_icons::initialize_icons(); + relm4_icons::initialize_icons(bowl::icons::GRESOURCE_BYTES, bowl::icons::RESOURCE_PREFIX); let app = relm4::RelmApp::new(bowl::APPLICATION_ID); relm4::set_global_css(".tag-pill button { -- cgit 1.4.1