switch to WidgetRef
This commit is contained in:
@@ -11,7 +11,7 @@ use openworm::net::{ClientMsg, NetClientMsg};
|
||||
|
||||
pub const SIZE: u32 = 20;
|
||||
|
||||
pub fn main_view(client: &mut Client, ui: &mut Ui) -> WidgetId {
|
||||
pub fn main_view(client: &mut Client, ui: &mut Ui) -> WidgetRef {
|
||||
let ClientState::LoggedIn(state) = &mut client.state else {
|
||||
panic!("we ain't logged in buh");
|
||||
};
|
||||
@@ -75,13 +75,13 @@ pub fn msg_panel(ui: &mut Ui, state: &mut LoggedIn) -> impl WidgetRet + use<> {
|
||||
let ClientState::LoggedIn(state) = &mut ctx.state.state else {
|
||||
panic!("we ain't logged in buh");
|
||||
};
|
||||
let content = ctx.ui.text(ctx.id).take();
|
||||
let content = ctx.widget.get_mut().take();
|
||||
let msg = NetClientMsg {
|
||||
content: content.clone(),
|
||||
};
|
||||
state.network.send(ClientMsg::SendMsg(msg.clone()));
|
||||
let msg = msg_widget(&state.username, &content).add(ctx.ui);
|
||||
ctx.ui[&msg_area].children.push(msg.any());
|
||||
msg_area.get_mut().children.push(msg.any());
|
||||
})
|
||||
.pad(15)
|
||||
.attr::<Selector>(send_text)
|
||||
|
||||
Reference in New Issue
Block a user