1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-08-16 22:31:03 +02:00

Send a dummy event on init so that the widget starts hidden

This commit is contained in:
postsolar 2025-05-17 10:22:26 +03:00
parent f6598f46d5
commit aa2d82469f

View file

@ -2,7 +2,7 @@ use crate::channels::{AsyncSenderExt, BroadcastReceiverExt};
use crate::clients::compositor::BindModeUpdate; use crate::clients::compositor::BindModeUpdate;
use crate::config::{CommonConfig, LayoutConfig, TruncateMode}; use crate::config::{CommonConfig, LayoutConfig, TruncateMode};
use crate::gtk_helpers::IronbarLabelExt; use crate::gtk_helpers::IronbarLabelExt;
use crate::modules::{Module, ModuleInfo, ModuleParts, WidgetContext}; use crate::modules::{Module, ModuleInfo, ModuleParts, ModuleUpdateEvent, WidgetContext};
use crate::{module_impl, spawn}; use crate::{module_impl, spawn};
use color_eyre::Result; use color_eyre::Result;
use gtk::Label; use gtk::Label;
@ -72,6 +72,15 @@ impl Module<Label> for Bindmode {
label.truncate(truncate); label.truncate(truncate);
} }
// Send a dummy event on init so that the widget starts hidden
{
let tx = context.tx.clone();
tx.send_spawn(ModuleUpdateEvent::Update(BindModeUpdate {
name: String::new(),
pango_markup: true,
}));
}
{ {
let label = label.clone(); let label = label.clone();