From 2864eb7cc3364cc0cce201e8f5f138a806559029 Mon Sep 17 00:00:00 2001 From: Sophie Herold Date: Fri, 22 Dec 2023 21:42:37 +0100 Subject: [PATCH] print: Only show one size input for percent --- src/widgets/print.rs | 11 +++++++++++ src/widgets/print.ui | 3 +-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/widgets/print.rs b/src/widgets/print.rs index 47e164a..db5ee02 100644 --- a/src/widgets/print.rs +++ b/src/widgets/print.rs @@ -764,6 +764,16 @@ impl LpPrint { fn on_size_unit_changed(&self) { let imp = self.imp(); + + // Only show one size input for percentage + if matches!(self.size_unit(), Unit::Percent) { + imp.width.set_title(&gettext("_Scale")); + imp.height.set_visible(false); + } else { + imp.width.set_title(&gettext("_Width")); + imp.height.set_visible(true); + } + let _ui_updates_disabled = self.disable_ui_updates(); let (orig_width, orig_height) = self.original_size(); @@ -792,6 +802,7 @@ impl LpPrint { fn on_margin_unit_changed(&self) { let imp = self.imp(); + let _ui_updates_disabled = self.disable_ui_updates(); let unit = self.margin_unit(); diff --git a/src/widgets/print.ui b/src/widgets/print.ui index 886e349..fb8d6b8 100644 --- a/src/widgets/print.ui +++ b/src/widgets/print.ui @@ -166,7 +166,6 @@ - _Width true @@ -196,4 +195,4 @@ - + \ No newline at end of file