mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-04-15 09:21:29 +03:00
use slab instead of reinventing the wheel (#112)
This commit is contained in:
committed by
GitHub
parent
279e582698
commit
3e96b42067
@@ -122,11 +122,11 @@ fn build_ui(app: &Application) {
|
||||
FrontendEvent::Activated(handle, active) => {
|
||||
window.activate_client(handle, active);
|
||||
}
|
||||
FrontendEvent::Created(client) => {
|
||||
window.new_client(client, false);
|
||||
FrontendEvent::Created(handle, client) => {
|
||||
window.new_client(handle, client, false);
|
||||
},
|
||||
FrontendEvent::Updated(client) => {
|
||||
window.update_client(client);
|
||||
FrontendEvent::Updated(handle, client) => {
|
||||
window.update_client(handle, client);
|
||||
}
|
||||
FrontendEvent::Error(e) => {
|
||||
window.show_toast(e.as_str());
|
||||
@@ -135,12 +135,12 @@ fn build_ui(app: &Application) {
|
||||
window.delete_client(client);
|
||||
}
|
||||
FrontendEvent::Enumerate(clients) => {
|
||||
for (client, active) in clients {
|
||||
if window.client_idx(client.handle).is_some() {
|
||||
window.activate_client(client.handle, active);
|
||||
window.update_client(client);
|
||||
for (handle, client, active) in clients {
|
||||
if window.client_idx(handle).is_some() {
|
||||
window.activate_client(handle, active);
|
||||
window.update_client(handle, client);
|
||||
} else {
|
||||
window.new_client(client, active);
|
||||
window.new_client(handle, client, active);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user