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
a91db1384e
commit
7818eb87c0
1 changed files with 31 additions and 17 deletions
|
|
@ -215,10 +215,6 @@ impl Dialog for PreferencesDialog {
|
||||||
let t = b[0].event[0].time(); // first event time to count from
|
let t = b[0].event[0].time(); // first event time to count from
|
||||||
for (i, r) in b.iter().enumerate() {
|
for (i, r) in b.iter().enumerate() {
|
||||||
g.add(&{
|
g.add(&{
|
||||||
let is_external = r
|
|
||||||
.redirect
|
|
||||||
.as_ref()
|
|
||||||
.is_some_and(|this| this.is_external(r).is_some_and(|v| v));
|
|
||||||
let a = ActionRow::builder()
|
let a = ActionRow::builder()
|
||||||
.css_classes(["property"])
|
.css_classes(["property"])
|
||||||
.subtitle_selectable(true)
|
.subtitle_selectable(true)
|
||||||
|
|
@ -227,21 +223,42 @@ impl Dialog for PreferencesDialog {
|
||||||
.build();
|
.build();
|
||||||
a.add_prefix(&{
|
a.add_prefix(&{
|
||||||
let c = i + 1;
|
let c = i + 1;
|
||||||
Button::builder()
|
let (css_class, tooltip_text) = if r
|
||||||
.css_classes([
|
.redirect
|
||||||
"circular",
|
.as_ref()
|
||||||
if is_external {
|
.is_some_and(|this| this.is_external(r).is_some_and(|v| v))
|
||||||
"warning"
|
{
|
||||||
} else if c == l {
|
if c == l {
|
||||||
"success"
|
("warning", "Current (External)")
|
||||||
} else {
|
} else {
|
||||||
"accent"
|
(
|
||||||
|
"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()
|
||||||
|
.css_classes(["circular", css_class])
|
||||||
|
.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)
|
||||||
.halign(Align::Center)
|
|
||||||
.build()
|
.build()
|
||||||
});
|
});
|
||||||
if let Some(ref redirect) = r.redirect {
|
if let Some(ref redirect) = r.redirect {
|
||||||
|
|
@ -250,9 +267,6 @@ impl Dialog for PreferencesDialog {
|
||||||
redirect.method.to_string(),
|
redirect.method.to_string(),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
if is_external {
|
|
||||||
a.add_suffix(&suffix("application-exit-symbolic", "External")) // @TODO links contain ⇖ text label indication
|
|
||||||
}
|
|
||||||
// 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