mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-08-17 14:51:04 +02:00
refactor: pass context into modules controllers
This paves the way to keep things tidier for the next refactors.
This commit is contained in:
parent
651a27b143
commit
57b57ed002
13 changed files with 30 additions and 20 deletions
|
@ -61,9 +61,10 @@ impl Module<gtk::Button> for UpowerModule {
|
|||
fn spawn_controller(
|
||||
&self,
|
||||
_info: &ModuleInfo,
|
||||
tx: mpsc::Sender<ModuleUpdateEvent<Self::SendMessage>>,
|
||||
context: &WidgetContext<Self::SendMessage, Self::ReceiveMessage>,
|
||||
_rx: mpsc::Receiver<Self::ReceiveMessage>,
|
||||
) -> Result<()> {
|
||||
let tx = context.tx.clone();
|
||||
spawn(async move {
|
||||
// await_sync due to strange "higher-ranked lifetime error"
|
||||
let display_proxy = await_sync(async move { get_display_proxy().await });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue