remove left aligns for text (default now)

This commit is contained in:
2025-11-21 13:34:28 -05:00
parent 6eac4f4576
commit 8eda92f5f5
3 changed files with 7 additions and 13 deletions

2
iris

Submodule iris updated: 5785352ac0...c428de8fd5

View File

@@ -100,7 +100,7 @@ impl Client {
} }
ServerMsg::LoadMsgs(msgs) => { ServerMsg::LoadMsgs(msgs) => {
if let Some(msg_area) = &self.channel { 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); let msg = msg_widget(msg).add(&mut self.ui);
self.ui[msg_area].children.push(msg.any()); self.ui[msg_area].children.push(msg.any());
} }

View File

@@ -33,7 +33,8 @@ pub fn main_view(client: &mut Client, network: NetSender) -> WidgetId {
let bg = ( let bg = (
image(include_bytes!("./assets/fuit.jpg")), image(include_bytes!("./assets/fuit.jpg")),
rect(Color::BLACK.alpha((0.8 * 255.0) as u8)), rect(Color::BLACK.alpha((0.8 * 255.0) as u8)),
).stack(); )
.stack();
(side_bar, msg_panel) (side_bar, msg_panel)
.span(Dir::RIGHT) .span(Dir::RIGHT)
.background(bg) .background(bg)
@@ -83,7 +84,7 @@ fn login_screen(client: &mut Client) -> WidgetId {
}) })
.height(40); .height(40);
let modal = ( let modal = (
text("login").size(30), text("login").text_align(Align::CENTER).size(30),
fbx(ip fbx(ip
.id_on(Edited, |id, client: &mut Client, _| { .id_on(Edited, |id, client: &mut Client, _| {
client.data.ip = client.ui[id].content(); client.data.ip = client.ui[id].content();
@@ -114,10 +115,9 @@ pub fn msg_widget(msg: Msg) -> impl WidgetLike<FnTag> {
let content = text(msg.content) let content = text(msg.content)
.editable() .editable()
.size(20) .size(20)
.text_align(Align::LEFT)
.wrap(true) .wrap(true)
.id_on(CursorSense::click(), |i, c, d| focus(i.clone(), c, d)); .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")) image(include_bytes!("./assets/sungals.png"))
.sized((70, 70)) .sized((70, 70))
@@ -155,12 +155,7 @@ pub fn msg_panel(client: &mut Client, network: NetSender) -> impl WidgetFn<Sized
let msg_area = Span::empty(Dir::DOWN).gap(15).add(ui); let msg_area = Span::empty(Dir::DOWN).gap(15).add(ui);
*channel = Some(msg_area.clone()); *channel = Some(msg_area.clone());
let send_text = text("") let send_text = text("").editable().size(20).wrap(true).add(ui);
.editable()
.size(20)
.wrap(true)
.text_align(Align::TOP_LEFT)
.add(ui);
( (
msg_area msg_area
@@ -191,5 +186,4 @@ pub fn msg_panel(client: &mut Client, network: NetSender) -> impl WidgetFn<Sized
) )
.span(Dir::DOWN) .span(Dir::DOWN)
.width(rest(1)) .width(rest(1))
// .background(rect(Color::BLACK.brighter(0.1)))
} }