mirror of
				https://github.com/Zedfrigg/ironbar.git
				synced 2025-11-03 23:11:54 +01: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
				
			
		| 
						 | 
				
			
			@ -162,7 +162,7 @@ where
 | 
			
		|||
    fn spawn_controller(
 | 
			
		||||
        &self,
 | 
			
		||||
        info: &ModuleInfo,
 | 
			
		||||
        tx: mpsc::Sender<ModuleUpdateEvent<Self::SendMessage>>,
 | 
			
		||||
        context: &WidgetContext<Self::SendMessage, Self::ReceiveMessage>,
 | 
			
		||||
        rx: mpsc::Receiver<Self::ReceiveMessage>,
 | 
			
		||||
    ) -> Result<()>
 | 
			
		||||
    where
 | 
			
		||||
| 
						 | 
				
			
			@ -208,8 +208,6 @@ where
 | 
			
		|||
 | 
			
		||||
    let (tx, rx) = broadcast::channel(64);
 | 
			
		||||
 | 
			
		||||
    module.spawn_controller(info, ui_tx.clone(), controller_rx)?;
 | 
			
		||||
 | 
			
		||||
    let context = WidgetContext {
 | 
			
		||||
        id,
 | 
			
		||||
        tx: ui_tx,
 | 
			
		||||
| 
						 | 
				
			
			@ -218,6 +216,8 @@ where
 | 
			
		|||
        _update_rx: rx,
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    module.spawn_controller(info, &context, controller_rx)?;
 | 
			
		||||
 | 
			
		||||
    let module_name = TModule::name();
 | 
			
		||||
    let instance_name = name.unwrap_or_else(|| module_name.to_string());
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue