Skip to content

Commit

Permalink
wip: print: Add accept_label
Browse files Browse the repository at this point in the history
Requires version 2.

See flatpak/xdg-desktop-portal#1094.
  • Loading branch information
A6GibKm committed Sep 2, 2023
1 parent 5b27879 commit 3bf4704
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/desktop/print.rs
Original file line number Diff line number Diff line change
Expand Up @@ -556,14 +556,24 @@ struct PreparePrintOptions {
handle_token: HandleToken,
/// Whether to make the dialog modal.
modal: Option<bool>,
/// Label for the accept button. Mnemonic underlines are allowed.
accept_label: Option<String>,
}

impl PreparePrintOptions {
/// Sets whether the dialog should be a modal.
#[must_use]
pub fn modal(mut self, modal: impl Into<Option<bool>>) -> Self {
self.modal = modal.into();
self
}

/// Label for the accept button. Mnemonic underlines are allowed.
#[must_use]
pub fn accept_label<'a>(mut self, accept_label: impl Into<Option<&'a str>>) -> Self {
self.accept_label = accept_label.into().map(ToOwned::to_owned);
self
}
}

#[derive(SerializeDict, Type, Debug, Default)]
Expand Down

0 comments on commit 3bf4704

Please sign in to comment.