use crate::config::CommonConfig; use crate::dynamic_value::dynamic_string; use crate::gtk_helpers::IronbarLabelExt; use crate::modules::{Module, ModuleInfo, ModuleParts, ModuleUpdateEvent, WidgetContext}; use crate::{glib_recv, module_impl, try_send}; use color_eyre::Result; use gtk::Label; use serde::Deserialize; use tokio::sync::mpsc; #[derive(Debug, Deserialize, Clone)] #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] pub struct LabelModule { /// The text to show on the label. /// This is a [Dynamic String](dynamic-values#dynamic-string). /// /// **Required** label: String, /// See [common options](module-level-options#common-options). #[serde(flatten)] pub common: Option, } impl LabelModule { pub(crate) fn new(label: String) -> Self { Self { label, common: Some(CommonConfig::default()), } } } impl Module