mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
update comment, var names
This commit is contained in:
parent
cea126d06d
commit
62534ab68d
1 changed files with 7 additions and 7 deletions
|
|
@ -238,7 +238,7 @@ impl Dialog for PreferencesDialog {
|
||||||
.build();
|
.build();
|
||||||
p.add(&{
|
p.add(&{
|
||||||
use gtk::{Align, Button};
|
use gtk::{Align, Button};
|
||||||
/// Common event number badge pattern
|
/// Common event badge pattern
|
||||||
fn b() -> Button {
|
fn b() -> Button {
|
||||||
Button::builder()
|
Button::builder()
|
||||||
.css_classes(["flat"])
|
.css_classes(["flat"])
|
||||||
|
|
@ -250,18 +250,18 @@ impl Dialog for PreferencesDialog {
|
||||||
}
|
}
|
||||||
/// Left (prefix) widget
|
/// Left (prefix) widget
|
||||||
fn l(b: Button, v: Option<(i64, i64)>) -> Button {
|
fn l(b: Button, v: Option<(i64, i64)>) -> Button {
|
||||||
if let Some((c, t)) = v {
|
if let Some((d, t)) = v {
|
||||||
b.add_css_class(if c == 0 {
|
b.add_css_class(if d == 0 {
|
||||||
"success"
|
"success"
|
||||||
} else if c > t {
|
} else if d > t {
|
||||||
"danger"
|
"danger"
|
||||||
} else {
|
} else {
|
||||||
"warning"
|
"warning"
|
||||||
});
|
});
|
||||||
b.set_label(&if c > 0 {
|
b.set_label(&if d > 0 {
|
||||||
format!("+{c}")
|
format!("+{d}")
|
||||||
} else {
|
} else {
|
||||||
c.to_string()
|
d.to_string()
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
b.add_css_class("success");
|
b.add_css_class("success");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue