This commit is contained in:
Ferdinand Schober
2025-03-14 22:12:33 +01:00
parent 77cddacc4a
commit f849135c61
3 changed files with 13 additions and 5 deletions

View File

@@ -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);
}
}

View File

@@ -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 {}

View File

@@ -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);
}
}