mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
update external redirect indication
This commit is contained in:
parent
7818eb87c0
commit
f2fb3c36ba
1 changed files with 10 additions and 31 deletions
|
|
@ -223,41 +223,14 @@ impl Dialog for PreferencesDialog {
|
||||||
.build();
|
.build();
|
||||||
a.add_prefix(&{
|
a.add_prefix(&{
|
||||||
let c = i + 1;
|
let c = i + 1;
|
||||||
let (css_class, tooltip_text) = if r
|
|
||||||
.redirect
|
|
||||||
.as_ref()
|
|
||||||
.is_some_and(|this| this.is_external(r).is_some_and(|v| v))
|
|
||||||
{
|
|
||||||
if c == l {
|
|
||||||
("warning", "Current (External)")
|
|
||||||
} else {
|
|
||||||
(
|
|
||||||
"warning",
|
|
||||||
if i == 0 {
|
|
||||||
"Initial request"
|
|
||||||
} else {
|
|
||||||
"External redirect"
|
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
|
||||||
} else if c == l {
|
|
||||||
("success", "Current")
|
|
||||||
} else {
|
|
||||||
(
|
|
||||||
"accent",
|
|
||||||
if i == 0 {
|
|
||||||
"Initial request"
|
|
||||||
} else {
|
|
||||||
"Internal redirect"
|
|
||||||
},
|
|
||||||
)
|
|
||||||
};
|
|
||||||
Button::builder()
|
Button::builder()
|
||||||
.css_classes(["circular", css_class])
|
.css_classes([
|
||||||
|
"circular",
|
||||||
|
if c == l { "success" } else { "accent" },
|
||||||
|
])
|
||||||
.halign(Align::Center)
|
.halign(Align::Center)
|
||||||
.label(c.to_string())
|
.label(c.to_string())
|
||||||
.sensitive(false)
|
.sensitive(false)
|
||||||
.tooltip_text(tooltip_text)
|
|
||||||
.valign(Align::Center)
|
.valign(Align::Center)
|
||||||
.build()
|
.build()
|
||||||
});
|
});
|
||||||
|
|
@ -267,6 +240,12 @@ impl Dialog for PreferencesDialog {
|
||||||
redirect.method.to_string(),
|
redirect.method.to_string(),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
if r.redirect
|
||||||
|
.as_ref()
|
||||||
|
.is_some_and(|this| this.is_external(r).is_some_and(|v| v))
|
||||||
|
{
|
||||||
|
a.add_suffix(&suffix("application-exit", "External redirect"))
|
||||||
|
}
|
||||||
// calculate total redirections time in ms
|
// calculate total redirections time in ms
|
||||||
let c = r.event.last().unwrap().time();
|
let c = r.event.last().unwrap().time();
|
||||||
a.set_subtitle(&if i == 0 {
|
a.set_subtitle(&if i == 0 {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue