From 1f405b3f83af7e826f4ab6770661e2c0a75b6885 Mon Sep 17 00:00:00 2001 From: grdddj Date: Fri, 12 May 2023 15:18:57 +0200 Subject: [PATCH] WIP - rename force_width to fixed_width --- .../rust/src/ui/model_tr/component/button.rs | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/core/embed/rust/src/ui/model_tr/component/button.rs b/core/embed/rust/src/ui/model_tr/component/button.rs index 8045cef05..760188c65 100644 --- a/core/embed/rust/src/ui/model_tr/component/button.rs +++ b/core/embed/rust/src/ui/model_tr/component/button.rs @@ -111,7 +111,7 @@ where let style = self.style(); // Button width may be forced. Otherwise calculate it. - let button_width = if let Some(width) = style.force_width { + let button_width = if let Some(width) = style.fixed_width { width } else { let outline = if style.with_outline { @@ -301,7 +301,7 @@ pub struct ButtonStyle { pub text_color: Color, pub with_outline: bool, pub with_arms: bool, - pub force_width: Option, + pub fixed_width: Option, pub offset: Option, } @@ -311,7 +311,7 @@ impl ButtonStyleSheet { active_color: Color, with_outline: bool, with_arms: bool, - force_width: Option, + fixed_width: Option, offset: Option, ) -> Self { Self { @@ -320,7 +320,7 @@ impl ButtonStyleSheet { text_color: normal_color, with_outline, with_arms, - force_width, + fixed_width, offset, }, active: ButtonStyle { @@ -328,7 +328,7 @@ impl ButtonStyleSheet { text_color: active_color, with_outline, with_arms, - force_width, + fixed_width, offset, }, } @@ -338,7 +338,7 @@ impl ButtonStyleSheet { pub fn default( with_outline: bool, with_arms: bool, - force_width: Option, + fixed_width: Option, offset: Option, ) -> Self { Self::new( @@ -346,7 +346,7 @@ impl ButtonStyleSheet { theme::BG, with_outline, with_arms, - force_width, + fixed_width, offset, ) } @@ -360,7 +360,7 @@ pub struct ButtonDetails { pub duration: Option, pub with_outline: bool, pub with_arms: bool, - pub force_width: Option, + pub fixed_width: Option, pub offset: Option, } @@ -373,7 +373,7 @@ impl ButtonDetails { duration: None, with_outline: true, with_arms: false, - force_width: None, + fixed_width: None, offset: None, } } @@ -386,7 +386,7 @@ impl ButtonDetails { duration: None, with_outline: true, with_arms: false, - force_width: None, + fixed_width: None, offset: None, } } @@ -427,12 +427,12 @@ impl ButtonDetails { /// Down arrow to signal paginating forward. Takes half the screen's width pub fn down_arrow_icon_wide() -> Self { - Self::icon(Icon::new(theme::ICON_ARROW_DOWN)).force_width(HALF_SCREEN_BUTTON_WIDTH) + Self::icon(Icon::new(theme::ICON_ARROW_DOWN)).fixed_width(HALF_SCREEN_BUTTON_WIDTH) } /// Up arrow to signal paginating back. Takes half the screen's width pub fn up_arrow_icon_wide() -> Self { - Self::icon(Icon::new(theme::ICON_ARROW_UP)).force_width(HALF_SCREEN_BUTTON_WIDTH) + Self::icon(Icon::new(theme::ICON_ARROW_UP)).fixed_width(HALF_SCREEN_BUTTON_WIDTH) } /// Icon of a bin to signal deleting. @@ -475,8 +475,8 @@ impl ButtonDetails { } /// Width of the button. - pub fn force_width(mut self, width: i16) -> Self { - self.force_width = Some(width); + pub fn fixed_width(mut self, width: i16) -> Self { + self.fixed_width = Some(width); self } @@ -485,7 +485,7 @@ impl ButtonDetails { ButtonStyleSheet::default( self.with_outline, self.with_arms, - self.force_width, + self.fixed_width, self.offset, ) }