mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
remove extra function
This commit is contained in:
parent
719c25e126
commit
22efd3ef9d
1 changed files with 18 additions and 19 deletions
|
|
@ -234,21 +234,6 @@ impl Dialog for PreferencesDialog {
|
||||||
.icon_name("system-run-symbolic")
|
.icon_name("system-run-symbolic")
|
||||||
.build();
|
.build();
|
||||||
p.add(&{
|
p.add(&{
|
||||||
use gtk::{Align, Label};
|
|
||||||
/// Right (prefix) widget
|
|
||||||
fn r(c: i64) -> Label {
|
|
||||||
Label::builder()
|
|
||||||
.css_classes(["flat", if c == 0 { "success" } else { "warning" }])
|
|
||||||
.halign(Align::End)
|
|
||||||
.label(if c > 0 {
|
|
||||||
format!("+{c} ms")
|
|
||||||
} else {
|
|
||||||
c.to_string()
|
|
||||||
})
|
|
||||||
.sensitive(false)
|
|
||||||
.valign(Align::Center)
|
|
||||||
.build()
|
|
||||||
}
|
|
||||||
let g = PreferencesGroup::new();
|
let g = PreferencesGroup::new();
|
||||||
let e = &info.event[0];
|
let e = &info.event[0];
|
||||||
let t = e.time();
|
let t = e.time();
|
||||||
|
|
@ -263,6 +248,8 @@ impl Dialog for PreferencesDialog {
|
||||||
);
|
);
|
||||||
for (i, e) in info.event[1..].iter().enumerate() {
|
for (i, e) in info.event[1..].iter().enumerate() {
|
||||||
g.add(&{
|
g.add(&{
|
||||||
|
use gtk::{Align, Label};
|
||||||
|
let c = e.time().difference(info.event[i].time()).as_milliseconds();
|
||||||
let a = ActionRow::builder()
|
let a = ActionRow::builder()
|
||||||
.use_markup(true)
|
.use_markup(true)
|
||||||
.subtitle(gformat!(
|
.subtitle(gformat!(
|
||||||
|
|
@ -273,10 +260,22 @@ impl Dialog for PreferencesDialog {
|
||||||
.title_selectable(true)
|
.title_selectable(true)
|
||||||
.title(e.name())
|
.title(e.name())
|
||||||
.build();
|
.build();
|
||||||
a.add_suffix(&r(e
|
a.add_suffix(
|
||||||
.time()
|
&Label::builder()
|
||||||
.difference(info.event[i].time())
|
.css_classes([
|
||||||
.as_milliseconds()));
|
"flat",
|
||||||
|
if c == 0 { "success" } else { "warning" },
|
||||||
|
])
|
||||||
|
.halign(Align::End)
|
||||||
|
.label(if c > 0 {
|
||||||
|
format!("+{c} ms")
|
||||||
|
} else {
|
||||||
|
c.to_string()
|
||||||
|
})
|
||||||
|
.sensitive(false)
|
||||||
|
.valign(Align::Center)
|
||||||
|
.build(),
|
||||||
|
);
|
||||||
a
|
a
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue