diff --git a/lan-mouse-gtk/src/client_row.rs b/lan-mouse-gtk/src/client_row.rs index 4e5bfe7..ca9c5f4 100644 --- a/lan-mouse-gtk/src/client_row.rs +++ b/lan-mouse-gtk/src/client_row.rs @@ -146,4 +146,8 @@ impl ClientRow { pub fn set_position(&self, pos: Position) { self.imp().set_pos(pos); } + + pub fn set_dns_state(&self, resolved: bool) { + self.imp().set_dns_state(resolved); + } } diff --git a/lan-mouse-gtk/src/client_row/imp.rs b/lan-mouse-gtk/src/client_row/imp.rs index fac7a52..8c5b20a 100644 --- a/lan-mouse-gtk/src/client_row/imp.rs +++ b/lan-mouse-gtk/src/client_row/imp.rs @@ -213,6 +213,14 @@ impl ClientRow { .set_active(active); self.enable_switch.unblock_signal(handler); } + + pub(super) fn set_dns_state(&self, resolved: bool) { + if resolved { + self.dns_button.set_css_classes(&["success"]) + } else { + self.dns_button.set_css_classes(&["warning"]) + } + } } impl WidgetImpl for ClientRow {} diff --git a/lan-mouse-gtk/src/window.rs b/lan-mouse-gtk/src/window.rs index 9fb8384..d155b5c 100644 --- a/lan-mouse-gtk/src/window.rs +++ b/lan-mouse-gtk/src/window.rs @@ -368,11 +368,7 @@ impl Window { fn update_dns_state(&self, handle: ClientHandle, resolved: bool) { if let Some(client_row) = self.row_for_handle(handle) { - if resolved { - client_row.imp().dns_button.set_css_classes(&["success"]) - } else { - client_row.imp().dns_button.set_css_classes(&["warning"]) - } + client_row.set_dns_state(resolved); } }