1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-08-17 14:51:04 +02:00

fix: markup escape issues

Fixes #629
This commit is contained in:
Jake Stanger 2024-10-15 22:10:37 +01:00
parent 56153f189a
commit b2db7b0bb5
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61
10 changed files with 51 additions and 30 deletions

View file

@ -1,9 +1,9 @@
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::prelude::*;
use gtk::Label;
use serde::Deserialize;
use tokio::sync::mpsc;
@ -56,12 +56,11 @@ impl Module<Label> for LabelModule {
context: WidgetContext<Self::SendMessage, Self::ReceiveMessage>,
_info: &ModuleInfo,
) -> Result<ModuleParts<Label>> {
let label = Label::new(None);
label.set_use_markup(true);
let label = Label::builder().use_markup(true).build();
{
let label = label.clone();
glib_recv!(context.subscribe(), string => label.set_markup(&string));
glib_recv!(context.subscribe(), string => label.set_label_escaped(&string));
}
Ok(ModuleParts {