From 8eda92f5f574025cdddc6374a1c9939698040b8e Mon Sep 17 00:00:00 2001 From: shadow cat Date: Fri, 21 Nov 2025 13:34:28 -0500 Subject: [PATCH] remove left aligns for text (default now) --- iris | 2 +- src/bin/client/main.rs | 2 +- src/bin/client/ui.rs | 16 +++++----------- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/iris b/iris index 5785352..c428de8 160000 --- a/iris +++ b/iris @@ -1 +1 @@ -Subproject commit 5785352ac0d8892c3c7abca2ef9673d426871483 +Subproject commit c428de8fd58306b7b417fe427c6b06bba6d6e195 diff --git a/src/bin/client/main.rs b/src/bin/client/main.rs index c5b67d9..d86cd44 100644 --- a/src/bin/client/main.rs +++ b/src/bin/client/main.rs @@ -100,7 +100,7 @@ impl Client { } ServerMsg::LoadMsgs(msgs) => { if let Some(msg_area) = &self.channel { - for msg in msgs { + for msg in msgs.into_iter().take(10) { let msg = msg_widget(msg).add(&mut self.ui); self.ui[msg_area].children.push(msg.any()); } diff --git a/src/bin/client/ui.rs b/src/bin/client/ui.rs index 4b04f7b..e499ff4 100644 --- a/src/bin/client/ui.rs +++ b/src/bin/client/ui.rs @@ -33,7 +33,8 @@ pub fn main_view(client: &mut Client, network: NetSender) -> WidgetId { let bg = ( image(include_bytes!("./assets/fuit.jpg")), rect(Color::BLACK.alpha((0.8 * 255.0) as u8)), - ).stack(); + ) + .stack(); (side_bar, msg_panel) .span(Dir::RIGHT) .background(bg) @@ -83,7 +84,7 @@ fn login_screen(client: &mut Client) -> WidgetId { }) .height(40); let modal = ( - text("login").size(30), + text("login").text_align(Align::CENTER).size(30), fbx(ip .id_on(Edited, |id, client: &mut Client, _| { client.data.ip = client.ui[id].content(); @@ -114,10 +115,9 @@ pub fn msg_widget(msg: Msg) -> impl WidgetLike { let content = text(msg.content) .editable() .size(20) - .text_align(Align::LEFT) .wrap(true) .id_on(CursorSense::click(), |i, c, d| focus(i.clone(), c, d)); - let header = text(msg.user).size(20).text_align(Align::LEFT); + let header = text(msg.user).size(20); ( image(include_bytes!("./assets/sungals.png")) .sized((70, 70)) @@ -155,12 +155,7 @@ pub fn msg_panel(client: &mut Client, network: NetSender) -> impl WidgetFn impl WidgetFn