Commit 8683be9 1 parent 3922a67 commit 8683be9 Copy full SHA for 8683be9
File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -196,7 +196,7 @@ pub struct Settings {
196
196
pub resolution : Option < String > ,
197
197
/// Whether to use color.
198
198
#[ zvariant( rename = "use-color" ) ]
199
- pub use_color : Option < bool > ,
199
+ pub use_color : Option < String > ,
200
200
/// Duplex printing mode, one of simplex, horizontal or vertical.
201
201
pub duplex : Option < String > ,
202
202
/// Whether to collate copies.
@@ -311,7 +311,12 @@ impl Settings {
311
311
/// Sets whether to use color.
312
312
#[ must_use]
313
313
pub fn use_color ( mut self , use_color : impl Into < Option < bool > > ) -> Self {
314
- self . use_color = use_color. into ( ) ;
314
+ let use_color = use_color. into ( ) . unwrap_or_default ( ) ;
315
+ if use_color {
316
+ self . use_color = Some ( "yes" . to_owned ( ) ) ;
317
+ } else {
318
+ self . use_color = Some ( "no" . to_owned ( ) )
319
+ } ;
315
320
self
316
321
}
317
322
You can’t perform that action at this time.
0 commit comments