summaryrefslogtreecommitdiff
path: root/schist_desktop_gui/src
diff options
context:
space:
mode:
authorJoe Carstairs <me@joeac.net>2026-02-12 10:18:42 +0000
committerJoe Carstairs <me@joeac.net>2026-02-12 10:18:42 +0000
commit8659e9df22908fb10afb8d949a523d347634e637 (patch)
treeed7914a8dd28f99cc9fcd6baf8778a5bf8e48e00 /schist_desktop_gui/src
parentb1988df5603a427994371d8176bce0c6c1f06fc2 (diff)
task-085: table contents are small text size
Diffstat (limited to 'schist_desktop_gui/src')
-rw-r--r--schist_desktop_gui/src/gui/components/table/view_table.rs2
-rw-r--r--schist_desktop_gui/src/gui/components/text.rs9
-rw-r--r--schist_desktop_gui/src/style.rs1
3 files changed, 11 insertions, 1 deletions
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;