@@ -4,7 +4,7 @@ use crate::appearance::{
44 BackgroundEffectRule , BlockOutFrom , BorderRule , CornerRadius , ShadowRule , TabIndicatorRule ,
55} ;
66use crate :: layout:: DefaultPresetSize ;
7- use crate :: utils:: RegexEq ;
7+ use crate :: utils:: { MergeWith , RegexEq } ;
88use crate :: FloatOrInt ;
99
1010#[ derive( knuffel:: Decode , Debug , Default , Clone , PartialEq ) ]
@@ -76,6 +76,30 @@ pub struct WindowRule {
7676 pub tiled_state : Option < bool > ,
7777 #[ knuffel( child, default ) ]
7878 pub background_effect : BackgroundEffectRule ,
79+ #[ knuffel( child, default ) ]
80+ pub popups : PopupsRule ,
81+ }
82+
83+ /// Rules for popup surfaces.
84+ #[ derive( knuffel:: Decode , Debug , Default , Clone , PartialEq ) ]
85+ pub struct PopupsRule {
86+ #[ knuffel( child, unwrap( argument) ) ]
87+ pub opacity : Option < f32 > ,
88+ }
89+
90+ /// Resolved popup-specific rules.
91+ #[ derive( Debug , Default , Clone , Copy , PartialEq ) ]
92+ pub struct ResolvedPopupsRules {
93+ /// Extra opacity to draw popups with.
94+ pub opacity : Option < f32 > ,
95+ }
96+
97+ impl MergeWith < PopupsRule > for ResolvedPopupsRules {
98+ fn merge_with ( & mut self , part : & PopupsRule ) {
99+ if let Some ( x) = part. opacity {
100+ self . opacity = Some ( x) ;
101+ }
102+ }
79103}
80104
81105#[ derive( knuffel:: Decode , Debug , Default , Clone , PartialEq ) ]
0 commit comments