Skip to content

Commit 8683be9

Browse files
desktop/print: Mark use-color as a String
No idea why it is a string...
1 parent 3922a67 commit 8683be9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/desktop/print.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ pub struct Settings {
196196
pub resolution: Option<String>,
197197
/// Whether to use color.
198198
#[zvariant(rename = "use-color")]
199-
pub use_color: Option<bool>,
199+
pub use_color: Option<String>,
200200
/// Duplex printing mode, one of simplex, horizontal or vertical.
201201
pub duplex: Option<String>,
202202
/// Whether to collate copies.
@@ -311,7 +311,12 @@ impl Settings {
311311
/// Sets whether to use color.
312312
#[must_use]
313313
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+
};
315320
self
316321
}
317322

0 commit comments

Comments
 (0)