From 0fa2ef4283ed0cfdfaa51318d7c3e578f419b18e Mon Sep 17 00:00:00 2001 From: ardocrat Date: Mon, 2 Jun 2025 21:54:13 +0300 Subject: [PATCH] qr: smaller text --- src/gui/views/qr.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/gui/views/qr.rs b/src/gui/views/qr.rs index e5288adc..b04b6147 100644 --- a/src/gui/views/qr.rs +++ b/src/gui/views/qr.rs @@ -123,9 +123,7 @@ impl QrCodeContent { self.qr_image_ui(svg, ui); // Show QR code text. - ui.add_space(6.0); - View::ellipsize_text(ui, self.text.clone(), 16.0, Colors::inactive_text()); - ui.add_space(6.0); + self.text_ui(ui); ui.vertical_centered(|ui| { let sharing = { @@ -216,9 +214,7 @@ impl QrCodeContent { self.qr_image_ui(svg, ui); // Show QR code text. - ui.add_space(6.0); - View::ellipsize_text(ui, self.text.clone(), 16.0, Colors::inactive_text()); - ui.add_space(6.0); + self.text_ui(ui); // Setup spacing between buttons. ui.spacing_mut().item_spacing = egui::Vec2::new(6.0, 0.0); @@ -298,6 +294,13 @@ impl QrCodeContent { }); } + /// Draw QR code text. + fn text_ui(&self, ui: &mut egui::Ui) { + ui.add_space(6.0); + View::ellipsize_text(ui, self.text.clone(), 15.0, Colors::inactive_text()); + ui.add_space(6.0); + } + /// Check if QR code is loading. fn loading(&self) -> bool { let r_state = self.qr_image_state.read();