From 4414718ebe6a653ccfd7d89405727ca61d6a5f00 Mon Sep 17 00:00:00 2001 From: Maximiliano Sandoval Date: Tue, 31 Dec 2024 12:53:14 +0100 Subject: [PATCH] account_add: Use property class in action rows --- data/resources/ui/account_add.ui | 40 ++++++++++---------------------- src/widgets/accounts/add.rs | 20 +++++++--------- 2 files changed, 21 insertions(+), 39 deletions(-) diff --git a/data/resources/ui/account_add.ui b/data/resources/ui/account_add.ui index 51217d1..0657bc8 100644 --- a/data/resources/ui/account_add.ui +++ b/data/resources/ui/account_add.ui @@ -155,51 +155,35 @@ Algorithm - - - end - center - True - - + Computing Method - - - end - center - True - - + Period Duration in seconds until the next password update - - - end - center - True - - + Digits Length of the generated code - - - end - center - True - - + diff --git a/src/widgets/accounts/add.rs b/src/widgets/accounts/add.rs index 44fa4c8..40a97df 100644 --- a/src/widgets/accounts/add.rs +++ b/src/widgets/accounts/add.rs @@ -46,15 +46,13 @@ mod imp { #[template_child] pub more_list: TemplateChild, #[template_child] - pub period_label: TemplateChild, - #[template_child] - pub digits_label: TemplateChild, + pub digits_row: TemplateChild, #[template_child] pub provider_entry: TemplateChild, #[template_child] - pub method_label: TemplateChild, + pub method_row: TemplateChild, #[template_child] - pub algorithm_label: TemplateChild, + pub algorithm_row: TemplateChild, #[template_child] pub counter_spinbutton: TemplateChild, #[template_child] @@ -315,17 +313,17 @@ impl AccountAddDialog { if let Some(provider) = provider { imp.more_list.set_visible(true); imp.provider_entry.set_text(&provider.name()); - imp.period_label.set_text(&provider.period().to_string()); + imp.period_row.set_subtitle(&provider.period().to_string()); imp.image.set_provider(Some(&provider)); - imp.method_label - .set_text(&provider.method().to_locale_string()); + imp.method_row + .set_subtitle(&provider.method().to_locale_string()); - imp.algorithm_label - .set_text(&provider.algorithm().to_locale_string()); + imp.algorithm_row + .set_subtitle(&provider.algorithm().to_locale_string()); - imp.digits_label.set_text(&provider.digits().to_string()); + imp.digits_row.set_subtitle(&provider.digits().to_string()); if provider.method().is_time_based() { imp.counter_spinbutton.set_visible(false);