1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-09 15:00:58 +00:00

fix(core/ui): style update: paging

[no changelog]
This commit is contained in:
Martin Milata 2023-03-10 16:42:45 +01:00
parent 19a2ea21b6
commit 670cbd7a1d
3 changed files with 164 additions and 82 deletions

View File

@ -2,11 +2,11 @@ use crate::ui::{
component::{ component::{
base::ComponentExt, base::ComponentExt,
paginated::{AuxPageMsg, PageMsg}, paginated::{AuxPageMsg, PageMsg},
Component, Event, EventCtx, FixedHeightBar, Label, Pad, Paginate, Component, Event, EventCtx, FixedHeightBar, Pad, Paginate,
}, },
display::{self, toif::Icon, Color}, display::{self, toif::Icon, Color},
geometry::{Insets, Rect}, geometry::{Grid, Insets, Rect},
model_tt::component::{Button, ButtonMsg}, model_tt::component::{Button, ButtonContent, ButtonMsg},
}; };
use super::{ use super::{
@ -14,14 +14,53 @@ use super::{
theme, CancelConfirmMsg, Loader, ScrollBar, Swipe, SwipeDirection, theme, CancelConfirmMsg, Loader, ScrollBar, Swipe, SwipeDirection,
}; };
pub struct SwipePage<T, U> { /// Describes behavior of left button.
enum ButtonPrevCancels {
/// Button never causes `PageMsg::Aux(AuxPageMsg::GoBack)` to be emitted.
Never,
/// Button cancels the layout if pressed on the first page. Otherwise it
/// goes to previous page.
FirstPage,
/// Button cancels the layout on any page, except the last where controls
/// are displayed.
AnyPage,
}
impl ButtonPrevCancels {
fn should_cancel(&self, is_first_page: bool) -> bool {
match self {
ButtonPrevCancels::Never => false,
ButtonPrevCancels::FirstPage => is_first_page,
ButtonPrevCancels::AnyPage => true,
}
}
fn icon(&self, is_first_page: bool) -> Icon {
let data = match self {
ButtonPrevCancels::Never => theme::ICON_UP,
ButtonPrevCancels::FirstPage if is_first_page => theme::ICON_CANCEL,
ButtonPrevCancels::FirstPage => theme::ICON_UP,
ButtonPrevCancels::AnyPage => theme::ICON_BACK,
};
Icon::new(data)
}
}
pub struct SwipePage<T, U>
where
U: Component,
{
content: T, content: T,
buttons: U, controls: U,
pad: Pad, pad: Pad,
swipe: Swipe, swipe: Swipe,
scrollbar: ScrollBar, scrollbar: ScrollBar,
hint: Label<&'static str>, button_prev: Button<&'static str>,
button_back: Option<Button<&'static str>>, button_next: Button<&'static str>,
button_prev_cancels: ButtonPrevCancels,
is_go_back: Option<fn(&U::Msg) -> bool>,
swipe_left: bool, swipe_left: bool,
fade: Option<u16>, fade: Option<u16>,
} }
@ -32,22 +71,38 @@ where
T: Component, T: Component,
U: Component, U: Component,
{ {
pub fn new(content: T, buttons: U, background: Color) -> Self { pub fn new(content: T, controls: U, background: Color) -> Self {
Self { Self {
content, content,
buttons, controls,
scrollbar: ScrollBar::vertical(), scrollbar: ScrollBar::vertical(),
swipe: Swipe::new(), swipe: Swipe::new(),
pad: Pad::with_background(background), pad: Pad::with_background(background),
hint: Label::centered("SWIPE TO CONTINUE", theme::label_page_hint()), button_prev: Button::with_icon(Icon::new(theme::ICON_UP)).initially_enabled(false),
button_back: None, button_next: Button::with_icon(Icon::new(theme::ICON_DOWN)),
button_prev_cancels: ButtonPrevCancels::Never,
is_go_back: None,
swipe_left: false, swipe_left: false,
fade: None, fade: None,
} }
} }
pub fn with_back_button(mut self) -> Self { pub fn with_back_button(mut self) -> Self {
self.button_back = Some(Button::with_icon(Icon::new(theme::ICON_BACK))); self.button_prev_cancels = ButtonPrevCancels::AnyPage;
self.button_prev = Button::with_icon(Icon::new(theme::ICON_BACK)).initially_enabled(true);
self
}
pub fn with_cancel_on_first_page(mut self) -> Self {
self.button_prev_cancels = ButtonPrevCancels::FirstPage;
self.button_prev = Button::with_icon(Icon::new(theme::ICON_CANCEL)).initially_enabled(true);
self
}
/// If `controls` message matches the function then we will go page back
/// instead of propagating the message to parent component.
pub fn with_go_back(mut self, is_go_back: fn(&U::Msg) -> bool) -> Self {
self.is_go_back = Some(is_go_back);
self self
} }
@ -66,6 +121,25 @@ where
// Adjust the swipe parameters according to the scrollbar. // Adjust the swipe parameters according to the scrollbar.
self.setup_swipe(); self.setup_swipe();
// Enable/disable prev/next buttons.
self.button_prev.set_content(
ctx,
ButtonContent::Icon(
self.button_prev_cancels
.icon(self.scrollbar.active_page == 0),
),
);
self.button_prev.enable_if(
ctx,
self.scrollbar.has_previous_page()
|| matches!(
self.button_prev_cancels,
ButtonPrevCancels::FirstPage | ButtonPrevCancels::AnyPage
),
);
self.button_next
.enable_if(ctx, self.scrollbar.has_next_page());
// Change the page in the content, make sure it gets completely repainted and // Change the page in the content, make sure it gets completely repainted and
// clear the background under it. // clear the background under it.
self.content.change_page(self.scrollbar.active_page); self.content.change_page(self.scrollbar.active_page);
@ -83,15 +157,10 @@ where
let mut layout = PageLayout::new(bounds); let mut layout = PageLayout::new(bounds);
self.pad.place(bounds); self.pad.place(bounds);
self.swipe.place(bounds); self.swipe.place(bounds);
self.button_prev.place(layout.button_prev);
self.button_next.place(layout.button_next);
if self.button_back.is_some() { let buttons_area = self.controls.place(layout.controls);
self.button_back.place(layout.hint_button);
self.hint.place(layout.hint_button_hint);
} else {
self.hint.place(layout.hint);
}
let buttons_area = self.buttons.place(layout.buttons);
layout.set_buttons_height(buttons_area.height()); layout.set_buttons_height(buttons_area.height());
self.scrollbar.place(layout.scrollbar); self.scrollbar.place(layout.scrollbar);
@ -159,14 +228,35 @@ where
return Some(PageMsg::Content(msg)); return Some(PageMsg::Content(msg));
} }
if !self.scrollbar.has_next_page() { if !self.scrollbar.has_next_page() {
if let Some(msg) = self.buttons.event(ctx, event) { if let Some(msg) = self.controls.event(ctx, event) {
// Handle the case when one of the controls buttons is configured to go back a
// page.
if let Some(f) = self.is_go_back {
if f(&msg) {
self.scrollbar.go_to_previous_page();
self.on_page_change(ctx);
return None;
}
}
return Some(PageMsg::Controls(msg)); return Some(PageMsg::Controls(msg));
} }
} else { } else {
if let Some(ButtonMsg::Clicked) = self.button_back.event(ctx, event) { if let Some(ButtonMsg::Clicked) = self.button_prev.event(ctx, event) {
return Some(PageMsg::Aux(AuxPageMsg::GoBack)); if self
.button_prev_cancels
.should_cancel(self.scrollbar.active_page == 0)
{
return Some(PageMsg::Aux(AuxPageMsg::GoBack));
}
self.scrollbar.go_to_previous_page();
self.on_page_change(ctx);
return None;
}
if let Some(ButtonMsg::Clicked) = self.button_next.event(ctx, event) {
self.scrollbar.go_to_next_page();
self.on_page_change(ctx);
return None;
} }
self.hint.event(ctx, event);
} }
None None
} }
@ -178,10 +268,10 @@ where
self.scrollbar.paint(); self.scrollbar.paint();
} }
if self.scrollbar.has_next_page() { if self.scrollbar.has_next_page() {
self.button_back.paint(); self.button_prev.paint();
self.hint.paint(); self.button_next.paint();
} else { } else {
self.buttons.paint(); self.controls.paint();
} }
if let Some(val) = self.fade.take() { if let Some(val) = self.fade.take() {
// Note that this is blocking and takes some time. // Note that this is blocking and takes some time.
@ -194,10 +284,10 @@ where
self.scrollbar.bounds(sink); self.scrollbar.bounds(sink);
self.content.bounds(sink); self.content.bounds(sink);
if !self.scrollbar.has_next_page() { if !self.scrollbar.has_next_page() {
self.buttons.bounds(sink); self.controls.bounds(sink);
} else { } else {
self.button_back.bounds(sink); self.button_prev.bounds(sink);
self.hint.bounds(sink); self.button_next.bounds(sink);
} }
} }
} }
@ -206,14 +296,14 @@ where
impl<T, U> crate::trace::Trace for SwipePage<T, U> impl<T, U> crate::trace::Trace for SwipePage<T, U>
where where
T: crate::trace::Trace, T: crate::trace::Trace,
U: crate::trace::Trace, U: crate::trace::Trace + Component,
{ {
fn trace(&self, t: &mut dyn crate::trace::Tracer) { fn trace(&self, t: &mut dyn crate::trace::Tracer) {
t.open("SwipePage"); t.open("SwipePage");
t.field("active_page", &self.scrollbar.active_page); t.field("active_page", &self.scrollbar.active_page);
t.field("page_count", &self.scrollbar.page_count); t.field("page_count", &self.scrollbar.page_count);
t.field("content", &self.content); t.field("content", &self.content);
t.field("buttons", &self.buttons); t.field("controls", &self.controls);
t.close(); t.close();
} }
} }
@ -226,43 +316,35 @@ pub struct PageLayout {
/// Scroll bar when multiple pages. /// Scroll bar when multiple pages.
pub scrollbar: Rect, pub scrollbar: Rect,
/// Controls displayed on last page. /// Controls displayed on last page.
pub buttons: Rect, pub controls: Rect,
/// Swipe to continue (unless back button enabled). pub button_prev: Rect,
pub hint: Rect, pub button_next: Rect,
/// Optional back button on every page.
pub hint_button: Rect,
/// Hint area when back button is enabled.
pub hint_button_hint: Rect,
} }
impl PageLayout { impl PageLayout {
const SCROLLBAR_WIDTH: i16 = 15; const SCROLLBAR_WIDTH: i16 = 8;
const SCROLLBAR_SPACE: i16 = 5; const SCROLLBAR_SPACE: i16 = 5;
const HINT_OFF: i16 = 19;
pub fn new(area: Rect) -> Self { pub fn new(area: Rect) -> Self {
let (_, hint) = area.split_bottom(Self::HINT_OFF); let (controls, _space) = area.split_right(theme::CONTENT_BORDER);
let (buttons, _space) = area.split_right(theme::CONTENT_BORDER);
let (_space, content) = area.split_left(theme::CONTENT_BORDER); let (_space, content) = area.split_left(theme::CONTENT_BORDER);
let (content_single_page, _space) = content.split_right(theme::CONTENT_BORDER); let (content_single_page, _space) = content.split_right(theme::CONTENT_BORDER);
let (content, scrollbar) = let (content, scrollbar) =
content.split_right(Self::SCROLLBAR_SPACE + Self::SCROLLBAR_WIDTH); content.split_right(Self::SCROLLBAR_SPACE + Self::SCROLLBAR_WIDTH);
let (_space, scrollbar) = scrollbar.split_left(Self::SCROLLBAR_SPACE); let (_space, scrollbar) = scrollbar.split_left(Self::SCROLLBAR_SPACE);
let (_, one_row_buttons) = area.split_bottom(theme::button_rows(1)); let (_, one_row_buttons) = area.split_bottom(theme::BUTTON_HEIGHT);
let (hint_button, hint_button_hint) = one_row_buttons.split_left(one_row_buttons.height()); let grid = Grid::new(one_row_buttons, 1, 2).with_spacing(theme::BUTTON_SPACING);
let vertical_inset = (hint_button_hint.height() - Self::HINT_OFF) / 2; let button_prev = grid.row_col(0, 0);
let hint_button_hint = let button_next = grid.row_col(0, 1);
hint_button_hint.inset(Insets::new(vertical_inset, 0, vertical_inset, 0));
Self { Self {
content_single_page, content_single_page,
content, content,
scrollbar, scrollbar,
buttons, controls,
hint, button_prev,
hint_button, button_next,
hint_button_hint,
} }
} }
@ -288,7 +370,7 @@ where
pub fn new(content: T, background: Color) -> Self { pub fn new(content: T, background: Color) -> Self {
let buttons = CancelHold::new(theme::button_confirm()); let buttons = CancelHold::new(theme::button_confirm());
Self { Self {
inner: SwipePage::new(content, buttons, background), inner: SwipePage::new(content, buttons, background).with_cancel_on_first_page(),
loader: Loader::new(), loader: Loader::new(),
pad: Pad::with_background(background), pad: Pad::with_background(background),
} }
@ -297,7 +379,7 @@ where
pub fn with_danger(content: T, background: Color) -> Self { pub fn with_danger(content: T, background: Color) -> Self {
let buttons = CancelHold::new(theme::button_danger()); let buttons = CancelHold::new(theme::button_danger());
Self { Self {
inner: SwipePage::new(content, buttons, background), inner: SwipePage::new(content, buttons, background).with_cancel_on_first_page(),
loader: Loader::new(), loader: Loader::new(),
pad: Pad::with_background(background), pad: Pad::with_background(background),
} }
@ -348,7 +430,7 @@ where
return Some(PageMsg::Controls(CancelConfirmMsg::Confirmed)); return Some(PageMsg::Controls(CancelConfirmMsg::Confirmed));
} }
if self.inner.pad.will_paint().is_some() { if self.inner.pad.will_paint().is_some() {
self.inner.buttons.request_complete_repaint(ctx); self.inner.controls.request_complete_repaint(ctx);
} }
None None
} }
@ -365,9 +447,10 @@ where
} }
} }
if self.inner.scrollbar.has_next_page() { if self.inner.scrollbar.has_next_page() {
self.inner.hint.paint(); self.inner.button_prev.paint();
self.inner.button_next.paint();
} else { } else {
self.inner.buttons.paint(); self.inner.controls.paint();
} }
if let Some(val) = self.inner.fade.take() { if let Some(val) = self.inner.fade.take() {
// Note that this is blocking and takes some time. // Note that this is blocking and takes some time.
@ -459,7 +542,7 @@ mod tests {
page.place(SCREEN); page.place(SCREEN);
let expected = let expected =
"<SwipePage active_page:0 page_count:1 content:<Paragraphs > buttons:<Empty > >"; "<SwipePage active_page:0 page_count:1 content:<Paragraphs > controls:<Empty > >";
assert_eq!(trace(&page), expected); assert_eq!(trace(&page), expected);
swipe_up(&mut page); swipe_up(&mut page);
@ -486,7 +569,7 @@ mod tests {
); );
page.place(SCREEN); page.place(SCREEN);
let expected = "<SwipePage active_page:0 page_count:1 content:<Paragraphs This is the first paragraph\nand it should fit on the\nscreen entirely.\nSecond, bold, paragraph\nshould also fit on the\nscreen whole I think.\n> buttons:<Empty > >"; let expected = "<SwipePage active_page:0 page_count:1 content:<Paragraphs This is the first\nparagraph and it should\nfit on the screen\nentirely.\nSecond, bold, paragraph\nshould also fit on the\nscreen whole I think.\n> controls:<Empty > >";
assert_eq!(trace(&page), expected); assert_eq!(trace(&page), expected);
swipe_up(&mut page); swipe_up(&mut page);
@ -509,8 +592,8 @@ mod tests {
); );
page.place(SCREEN); page.place(SCREEN);
let expected1 = "<SwipePage active_page:0 page_count:2 content:<Paragraphs This is somewhat long\nparagraph that goes on\nand on and on and on\nand on and will definitely\nnot fit on just a single\nscreen. You have to\nswipe a bit to see all the\ntext it contains I...\n> buttons:<FixedHeightBar inner:<Button text:NO > > >"; let expected1 = "<SwipePage active_page:0 page_count:2 content:<Paragraphs This is somewhat long\nparagraph that goes on\nand on and on and on and\non and will definitely not\nfit on just a single\nscreen. You have to\nswipe a bit to see all the\ntext it contains I guess....\n> controls:<FixedHeightBar inner:<Button text:NO > > >";
let expected2 = "<SwipePage active_page:1 page_count:2 content:<Paragraphs guess. There's just so\nmuch letters in it.\n> buttons:<FixedHeightBar inner:<Button text:NO > > >"; let expected2 = "<SwipePage active_page:1 page_count:2 content:<Paragraphs There's just so much\nletters in it.\n> controls:<FixedHeightBar inner:<Button text:NO > > >";
assert_eq!(trace(&page), expected1); assert_eq!(trace(&page), expected1);
swipe_down(&mut page); swipe_down(&mut page);
@ -545,9 +628,9 @@ mod tests {
); );
page.place(SCREEN); page.place(SCREEN);
let expected1 = "<SwipePage active_page:0 page_count:3 content:<Paragraphs This paragraph is using a\nbold font. It doesn't\nneed to be all that long.\nAnd this one is\nusing MONO. Mono\nspace is nice fo\nr numbers,...\n> buttons:<FixedHeightBar inner:<Button text:IDK > > >"; let expected1 = "<SwipePage active_page:0 page_count:3 content:<Paragraphs This paragraph is using a\nbold font. It doesn't need\nto be all that long.\nAnd this one is u\nsing MONO. Monosp\nace is nice for n\numbers, they...\n> controls:<FixedHeightBar inner:<Button text:IDK > > >";
let expected2 = "<SwipePage active_page:1 page_count:3 content:<Paragraphs ...they have th\ne same width and\ncan be scanned q\nuickly. Even if\nthey span severa\nl pages or somet\nhing.\n> buttons:<FixedHeightBar inner:<Button text:IDK > > >"; let expected2 = "<SwipePage active_page:1 page_count:3 content:<Paragraphs ...have the same\nwidth and can be\nscanned quickly.\nEven if they span\nseveral pages or\nsomething.\nLet's add another one...\n> controls:<FixedHeightBar inner:<Button text:IDK > > >";
let expected3 = "<SwipePage active_page:2 page_count:3 content:<Paragraphs Let's add another one\nfor a good measure. This\none should overflow all\nthe way to the third\npage with a bit of luck.\n> buttons:<FixedHeightBar inner:<Button text:IDK > > >"; let expected3 = "<SwipePage active_page:2 page_count:3 content:<Paragraphs for a good measure. This\none should overflow all\nthe way to the third page\nwith a bit of luck.\n> controls:<FixedHeightBar inner:<Button text:IDK > > >";
assert_eq!(trace(&page), expected1); assert_eq!(trace(&page), expected1);
swipe_down(&mut page); swipe_down(&mut page);
@ -579,9 +662,9 @@ mod tests {
); );
page.place(SCREEN); page.place(SCREEN);
let expected1 = "<SwipePage active_page:0 page_count:3 content:<Paragraphs Short one.\n> buttons:<FixedHeightBar inner:<Empty > > >"; let expected1 = "<SwipePage active_page:0 page_count:3 content:<Paragraphs Short one.\n> controls:<FixedHeightBar inner:<Empty > > >";
let expected2 = "<SwipePage active_page:1 page_count:3 content:<Paragraphs Short two.\n> buttons:<FixedHeightBar inner:<Empty > > >"; let expected2 = "<SwipePage active_page:1 page_count:3 content:<Paragraphs Short two.\n> controls:<FixedHeightBar inner:<Empty > > >";
let expected3 = "<SwipePage active_page:2 page_count:3 content:<Paragraphs Short three.\n> buttons:<FixedHeightBar inner:<Empty > > >"; let expected3 = "<SwipePage active_page:2 page_count:3 content:<Paragraphs Short three.\n> controls:<FixedHeightBar inner:<Empty > > >";
assert_eq!(trace(&page), expected1); assert_eq!(trace(&page), expected1);
swipe_up(&mut page); swipe_up(&mut page);

View File

@ -421,7 +421,7 @@ extern "C" fn new_confirm_action(n_args: usize, args: *const Obj, kwargs: *mut M
LayoutObj::new(Frame::left_aligned( LayoutObj::new(Frame::left_aligned(
theme::label_title(), theme::label_title(),
title, title,
SwipePage::new(paragraphs, buttons, theme::BG), SwipePage::new(paragraphs, buttons, theme::BG).with_cancel_on_first_page(),
))? ))?
}; };
Ok(obj.into()) Ok(obj.into())
@ -459,7 +459,7 @@ fn confirm_blob(
LayoutObj::new(Frame::left_aligned( LayoutObj::new(Frame::left_aligned(
theme::label_title(), theme::label_title(),
title, title,
SwipePage::new(paragraphs, buttons, theme::BG), SwipePage::new(paragraphs, buttons, theme::BG).with_cancel_on_first_page(),
))? ))?
} else { } else {
panic!("Either `hold=true` or `verb=Some(StrBuffer)` must be specified"); panic!("Either `hold=true` or `verb=Some(StrBuffer)` must be specified");
@ -513,7 +513,9 @@ extern "C" fn new_confirm_address(n_args: usize, args: *const Obj, kwargs: *mut
Frame::left_aligned( Frame::left_aligned(
theme::label_title(), theme::label_title(),
title, title,
SwipePage::new(paragraphs, buttons, theme::BG).with_swipe_left(), SwipePage::new(paragraphs, buttons, theme::BG)
.with_swipe_left()
.with_cancel_on_first_page(),
), ),
))?; ))?;
Ok(obj.into()) Ok(obj.into())
@ -529,7 +531,7 @@ extern "C" fn new_confirm_properties(n_args: usize, args: *const Obj, kwargs: *m
let paragraphs = PropsList::new( let paragraphs = PropsList::new(
items, items,
&theme::TEXT_BOLD, &theme::TEXT_DEMIBOLD,
&theme::TEXT_NORMAL, &theme::TEXT_NORMAL,
&theme::TEXT_MONO, &theme::TEXT_MONO,
)?; )?;
@ -544,7 +546,8 @@ extern "C" fn new_confirm_properties(n_args: usize, args: *const Obj, kwargs: *m
LayoutObj::new(Frame::left_aligned( LayoutObj::new(Frame::left_aligned(
theme::label_title(), theme::label_title(),
title, title,
SwipePage::new(paragraphs.into_paragraphs(), buttons, theme::BG), SwipePage::new(paragraphs.into_paragraphs(), buttons, theme::BG)
.with_cancel_on_first_page(),
))? ))?
}; };
Ok(obj.into()) Ok(obj.into())
@ -743,7 +746,7 @@ extern "C" fn new_confirm_modify_output(n_args: usize, args: *const Obj, kwargs:
let obj = LayoutObj::new(Frame::left_aligned( let obj = LayoutObj::new(Frame::left_aligned(
theme::label_title(), theme::label_title(),
"MODIFY AMOUNT", "MODIFY AMOUNT",
SwipePage::new(paragraphs, buttons, theme::BG), SwipePage::new(paragraphs, buttons, theme::BG).with_cancel_on_first_page(),
))?; ))?;
Ok(obj.into()) Ok(obj.into())
}; };
@ -778,7 +781,7 @@ extern "C" fn new_confirm_modify_fee(n_args: usize, args: *const Obj, kwargs: *m
let obj = LayoutObj::new(Frame::left_aligned( let obj = LayoutObj::new(Frame::left_aligned(
theme::label_title(), theme::label_title(),
"MODIFY FEE", "MODIFY FEE",
SwipePage::new(paragraphs, buttons, theme::BG), SwipePage::new(paragraphs, buttons, theme::BG).with_cancel_on_first_page(),
))?; ))?;
Ok(obj.into()) Ok(obj.into())
}; };
@ -1930,7 +1933,7 @@ mod tests {
layout.place(SCREEN); layout.place(SCREEN);
assert_eq!( assert_eq!(
trace(&layout), trace(&layout),
"<Dialog content:<Text content:Testing text layout, with\nsome text, and some more\ntext. And parameters! > controls:<FixedHeightBar inner:<Tuple 0:<GridPlaced inner:<Button text:Left > > 1:<GridPlaced inner:<Button text:Right > > > > >", "<Dialog content:<Text content:Testing text layout, with\nsome text, and some\nmore text. And parame-\nters! > controls:<FixedHeightBar inner:<Split first:<Button text:Left > second:<Button text:Right > > > >",
) )
} }
} }

View File

@ -128,10 +128,6 @@ pub const fn label_keyboard_minor() -> TextStyle {
TEXT_NORMAL_OFF_WHITE TEXT_NORMAL_OFF_WHITE
} }
pub const fn label_page_hint() -> TextStyle {
TextStyle::new(Font::BOLD, GREY_LIGHT, BG, GREY_LIGHT, GREY_LIGHT)
}
pub const fn label_warning() -> TextStyle { pub const fn label_warning() -> TextStyle {
TEXT_DEMIBOLD TEXT_DEMIBOLD
} }
@ -564,11 +560,11 @@ pub const fn button_bar<T>(inner: T) -> FixedHeightBar<T> {
/// | 14 | /// | 14 |
/// +----------+ /// +----------+
pub const fn borders() -> Insets { pub const fn borders() -> Insets {
Insets::new(13, 10, 14, 10) Insets::new(6, 6, 6, 6)
} }
pub const fn borders_scroll() -> Insets { pub const fn borders_scroll() -> Insets {
Insets::new(13, 5, 14, 10) Insets::new(6, 6, 6, 6)
} }
pub const fn borders_horizontal_scroll() -> Insets { pub const fn borders_horizontal_scroll() -> Insets {
@ -576,5 +572,5 @@ pub const fn borders_horizontal_scroll() -> Insets {
} }
pub const fn borders_notification() -> Insets { pub const fn borders_notification() -> Insets {
Insets::new(48, 10, 14, 10) Insets::new(48, 6, 6, 6)
} }