mirror of
				https://github.com/Zedfrigg/ironbar.git
				synced 2025-11-04 07:21:54 +01:00 
			
		
		
		
	feat: module-level name and class options
		
	BREAKING CHANGE: To allow for the `name` property, any widgets that were previously targeted by name should be targeted by class instead. This affects **all modules and all popups**, as well as several widgets inside modules. **This will break a lot of rules in your stylesheet**. To attempt to mitigate the damage, a migration script can be found [here](https://raw.githubusercontent.com/JakeStanger/ironbar/master/scripts/migrate-styles.sh) that should get you most of the way. Resolves #75.
This commit is contained in:
		
					parent
					
						
							
								528a8d6dd6
							
						
					
				
			
			
				commit
				
					
						dea66415c2
					
				
			
		
					 30 changed files with 352 additions and 215 deletions
				
			
		| 
						 | 
				
			
			@ -10,8 +10,11 @@ use tracing::trace;
 | 
			
		|||
 | 
			
		||||
/// Common configuration options
 | 
			
		||||
/// which can be set on every module.
 | 
			
		||||
#[derive(Debug, Deserialize, Clone)]
 | 
			
		||||
#[derive(Debug, Default, Deserialize, Clone)]
 | 
			
		||||
pub struct CommonConfig {
 | 
			
		||||
    pub class: Option<String>,
 | 
			
		||||
    pub name: Option<String>,
 | 
			
		||||
 | 
			
		||||
    pub show_if: Option<ScriptInput>,
 | 
			
		||||
    pub transition_type: Option<TransitionType>,
 | 
			
		||||
    pub transition_duration: Option<u32>,
 | 
			
		||||
| 
						 | 
				
			
			@ -54,7 +57,7 @@ impl TransitionType {
 | 
			
		|||
 | 
			
		||||
impl CommonConfig {
 | 
			
		||||
    /// Configures the module's container according to the common config options.
 | 
			
		||||
    pub fn install(mut self, container: &EventBox, revealer: &Revealer) {
 | 
			
		||||
    pub fn install_events(mut self, container: &EventBox, revealer: &Revealer) {
 | 
			
		||||
        self.install_show_if(container, revealer);
 | 
			
		||||
 | 
			
		||||
        let left_click_script = self.on_click_left.map(Script::new_polling);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue