This commit is contained in:
2025-11-15 02:23:32 -05:00
parent 2e00389033
commit b7f2d8b7c3
2 changed files with 13 additions and 9 deletions

View File

@@ -27,13 +27,12 @@ pub fn main_view(ui: &mut Ui, network: NetSender) -> WidgetId<AnyWidget> {
}
fn login_screen(ui: &mut Ui, handle: AppHandle) -> WidgetId<AnyWidget> {
let field = |name| text(name).editable().size(20);
let mut field = |name| text(name).editable().size(20).add(ui);
let ip = field("ip");
// let username = field("username");
// let password = field("password");
let mut fbx = |field: TextBuilder<TextEditOutput>| {
let field = field.add(ui);
let fbx = |field: WidgetId<TextEdit>| {
field
.clone()
.pad(10)
@@ -41,12 +40,14 @@ fn login_screen(ui: &mut Ui, handle: AppHandle) -> WidgetId<AnyWidget> {
.on(CursorSense::click(), focus(field))
};
let ip_ = ip.clone();
let color = Color::GREEN;
let submit = rect(color)
.radius(15)
.id_on(CursorSense::click(), move |id, client: &mut Client, _| {
client.ui[id].color = color.darker(0.3);
connect(handle.clone());
let ip = client.ui[&ip_].content();
connect(handle.clone(), ip);
})
.height(40);
(