From d844c4306c5582e91b99cc87ffe0798d64556aad Mon Sep 17 00:00:00 2001 From: bunnie Date: Sat, 28 Oct 2023 22:50:23 +0800 Subject: [PATCH] reduce size of chat status bar to match status bars above --- libs/chat/src/ui.rs | 7 ++++--- services/graphics-server/src/testing.rs | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libs/chat/src/ui.rs b/libs/chat/src/ui.rs index a5e44df00..9e37365aa 100644 --- a/libs/chat/src/ui.rs +++ b/libs/chat/src/ui.rs @@ -131,17 +131,18 @@ impl Ui { // setup the initial status bar contents let margin = Point::new(4, 4); let status_height = gam.glyph_height_hint( - graphics_server::api::text::TEXTVIEW_DEFAULT_STYLE).unwrap() as u16 - + margin.y as u16 * 2; + GlyphStyle::Regular).unwrap() as u16; let mut status_tv = TextView::new(canvas, TextBounds::BoundingBox(Rectangle::new( Point::new(0, 0), - Point::new(screensize.x, status_height as i16) + Point::new(screensize.x, status_height as _), )) ); + status_tv.style = GlyphStyle::Regular; status_tv.margin = margin; status_tv.draw_border = false; status_tv.clear_area = true; + status_tv.margin = Point::new(0, 0); write!(status_tv, "{}", t!("chat.status.initial", locales::LANG).to_string()).ok(); let tt = ticktimer_server::Ticktimer::new().unwrap(); let status_last_update_ms = tt.elapsed_ms(); diff --git a/services/graphics-server/src/testing.rs b/services/graphics-server/src/testing.rs index 716ef9bfe..8ea7e7635 100644 --- a/services/graphics-server/src/testing.rs +++ b/services/graphics-server/src/testing.rs @@ -56,7 +56,7 @@ pub fn tests() { let mut tv = TextView::new(Gid::new([0, 0, 0, 0]), TextBounds::BoundingBox(anim_rect)); tv.clip_rect = Some(clipping_area); - tv.style = TEST_STYLE; + tv.style = GlyphStyle::Small; tv.ellipsis = false; write!(tv, "Test of busy animation").unwrap(); tv.insertion = None;