From 8659e9df22908fb10afb8d949a523d347634e637 Mon Sep 17 00:00:00 2001 From: Joe Carstairs Date: Thu, 12 Feb 2026 10:18:42 +0000 Subject: task-085: table contents are small text size --- schist_desktop_gui/src/gui/components/table/view_table.rs | 2 +- schist_desktop_gui/src/gui/components/text.rs | 9 +++++++++ schist_desktop_gui/src/style.rs | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/schist_desktop_gui/src/gui/components/table/view_table.rs b/schist_desktop_gui/src/gui/components/table/view_table.rs index 801bbb7..3d4da64 100644 --- a/schist_desktop_gui/src/gui/components/table/view_table.rs +++ b/schist_desktop_gui/src/gui/components/table/view_table.rs @@ -48,7 +48,7 @@ where } fn format_string(text: &String) -> Text { - Text::default(text).weak() + Text::default(text).weak().small() } fn format_currency(amount: i32) -> Text { diff --git a/schist_desktop_gui/src/gui/components/text.rs b/schist_desktop_gui/src/gui/components/text.rs index b67a7aa..36a6a13 100644 --- a/schist_desktop_gui/src/gui/components/text.rs +++ b/schist_desktop_gui/src/gui/components/text.rs @@ -35,6 +35,7 @@ enum Strength { #[derive(Clone, Debug, PartialEq)] enum Size { VSmall, + Small, Base, } @@ -74,6 +75,13 @@ impl Text { } } + pub fn small(&self) -> Self { + Self { + size: Some(Size::Small), + ..self.clone() + } + } + pub fn danger(&self) -> Self { Self { colour: Some(Colour::Danger), @@ -133,6 +141,7 @@ where iced::widget::text(text.borrow().content.clone()) .size(match text.borrow().size { Some(Size::VSmall) => TEXT_SIZE_V_SM, + Some(Size::Small) => TEXT_SIZE_SM, Some(Size::Base) | None => TEXT_SIZE_BASE, }) .align_x(match &text.borrow().align { diff --git a/schist_desktop_gui/src/style.rs b/schist_desktop_gui/src/style.rs index 45a9aeb..fd7c858 100644 --- a/schist_desktop_gui/src/style.rs +++ b/schist_desktop_gui/src/style.rs @@ -2,4 +2,5 @@ pub const SPACING_MD: u16 = 24; pub const SPACING_LG: u16 = 32; pub const TEXT_SIZE_V_SM: u16 = 12; +pub const TEXT_SIZE_SM: u16 = 14; pub const TEXT_SIZE_BASE: u16 = 16; -- cgit v1.2.3