IP
This commit is contained in:
@@ -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);
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user