Skip to content

Commit 1cbcd72

Browse files
author
yggverse
committed
highlight proxy lookup issues with the error class
1 parent 0e71b44 commit 1cbcd72

1 file changed

Lines changed: 19 additions & 19 deletions

File tree

  • src/app/browser/window/tab/item/page/navigation

src/app/browser/window/tab/item/page/navigation/request.rs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -139,27 +139,27 @@ impl Request {
139139
s.update(Some(50)); // @TODO optional
140140
}
141141
// Indicate proxy connections @TODO cancel previous operation on update
142-
{
143-
const C: &str = "accent";
144-
match p.proxy.matches(&t) {
145-
Some(r) => {
146-
e.set_css_classes(&[C]);
147-
r.lookup_async(&t, Cancellable::NONE, {
148-
let e = e.clone();
149-
move |r| {
150-
e.set_tooltip_text(Some(&{
151-
match r {
152-
Ok(h) => format!("Proxy over {}", h.join(",")),
153-
Err(e) => e.to_string(),
154-
}
155-
}))
142+
match p.proxy.matches(&t) {
143+
Some(r) => r.lookup_async(&t, Cancellable::NONE, {
144+
let e = e.clone();
145+
move |r| {
146+
e.set_tooltip_text(Some(&{
147+
match r {
148+
Ok(h) => {
149+
e.set_css_classes(&["accent"]);
150+
format!("Proxy over {}", h.join(","))
151+
}
152+
Err(i) => {
153+
e.set_css_classes(&["error"]);
154+
i.to_string()
155+
}
156156
}
157-
});
158-
}
159-
None => {
160-
e.remove_css_class(C);
161-
e.set_tooltip_text(None)
157+
}))
162158
}
159+
}),
160+
None => {
161+
e.set_css_classes(&[]);
162+
e.set_tooltip_text(None)
163163
}
164164
}
165165
}

0 commit comments

Comments
 (0)