From bc6cd9daafd177af9f66ae8fcd234fdba29b47a6 Mon Sep 17 00:00:00 2001 From: Maximiliano Sandoval Date: Tue, 31 Dec 2024 12:48:48 +0100 Subject: [PATCH] details_page: Use property class in action rows --- data/resources/ui/account_details_page.ui | 38 +++++++++-------------- src/widgets/accounts/details.rs | 20 ++++++------ 2 files changed, 24 insertions(+), 34 deletions(-) diff --git a/data/resources/ui/account_details_page.ui b/data/resources/ui/account_details_page.ui index 7b91174..88f592b 100644 --- a/data/resources/ui/account_details_page.ui +++ b/data/resources/ui/account_details_page.ui @@ -115,23 +115,19 @@ none 18 - + Algorithm - - - end - - + - + Computing Method - - - end - - + @@ -147,22 +143,18 @@ Period Duration in seconds until the next password update - - - end - - + - + Digits Length of the generated code - - - end - - + diff --git a/src/widgets/accounts/details.rs b/src/widgets/accounts/details.rs index 37932b7..89865ca 100644 --- a/src/widgets/accounts/details.rs +++ b/src/widgets/accounts/details.rs @@ -33,15 +33,13 @@ mod imp { #[template_child(id = "list")] pub listbox: TemplateChild, #[template_child] - pub algorithm_label: TemplateChild, + pub algorithm_row: TemplateChild, #[template_child] - pub method_label: TemplateChild, + pub method_row: TemplateChild, #[template_child] pub counter_spinbutton: TemplateChild, #[template_child] - pub period_label: TemplateChild, - #[template_child] - pub digits_label: TemplateChild, + pub digits_row: TemplateChild, #[template_child] pub period_row: TemplateChild, #[template_child] @@ -164,19 +162,19 @@ impl AccountDetailsPage { fn set_provider(&self, provider: Provider) { let imp = self.imp(); imp.provider_entry.set_text(&provider.name()); - imp.algorithm_label - .set_text(&provider.algorithm().to_locale_string()); - imp.method_label - .set_text(&provider.method().to_locale_string()); + imp.algorithm_row + .set_subtitle(&provider.algorithm().to_locale_string()); + imp.method_row + .set_subtitle(&provider.method().to_locale_string()); if provider.method().is_event_based() { imp.counter_spinbutton.set_visible(true); imp.period_row.set_visible(false); } else { imp.counter_spinbutton.set_visible(false); imp.period_row.set_visible(true); - imp.period_label.set_text(&provider.period().to_string()); + imp.period_row.set_subtitle(&provider.period().to_string()); } - imp.digits_label.set_text(&provider.digits().to_string()); + imp.digits_row.set_subtitle(&provider.digits().to_string()); if let Some(help) = provider.help_url() { imp.help_row.set_uri(help); imp.help_row.set_visible(true);