mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-08-17 23:01:04 +02:00
Send a dummy event on init so that the widget starts hidden
This commit is contained in:
parent
f6598f46d5
commit
aa2d82469f
1 changed files with 10 additions and 1 deletions
|
@ -2,7 +2,7 @@ use crate::channels::{AsyncSenderExt, BroadcastReceiverExt};
|
|||
use crate::clients::compositor::BindModeUpdate;
|
||||
use crate::config::{CommonConfig, LayoutConfig, TruncateMode};
|
||||
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 color_eyre::Result;
|
||||
use gtk::Label;
|
||||
|
@ -72,6 +72,15 @@ impl Module<Label> for Bindmode {
|
|||
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();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue