From 62534ab68d27c7a409abd1cb39d7a473b723af36 Mon Sep 17 00:00:00 2001 From: yggverse Date: Mon, 24 Mar 2025 09:16:48 +0200 Subject: [PATCH] update comment, var names --- .../item/page/navigation/request/info/dialog.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/app/browser/window/tab/item/page/navigation/request/info/dialog.rs b/src/app/browser/window/tab/item/page/navigation/request/info/dialog.rs index 063a4c82..1a0a6269 100644 --- a/src/app/browser/window/tab/item/page/navigation/request/info/dialog.rs +++ b/src/app/browser/window/tab/item/page/navigation/request/info/dialog.rs @@ -238,7 +238,7 @@ impl Dialog for PreferencesDialog { .build(); p.add(&{ use gtk::{Align, Button}; - /// Common event number badge pattern + /// Common event badge pattern fn b() -> Button { Button::builder() .css_classes(["flat"]) @@ -250,18 +250,18 @@ impl Dialog for PreferencesDialog { } /// Left (prefix) widget fn l(b: Button, v: Option<(i64, i64)>) -> Button { - if let Some((c, t)) = v { - b.add_css_class(if c == 0 { + if let Some((d, t)) = v { + b.add_css_class(if d == 0 { "success" - } else if c > t { + } else if d > t { "danger" } else { "warning" }); - b.set_label(&if c > 0 { - format!("+{c}") + b.set_label(&if d > 0 { + format!("+{d}") } else { - c.to_string() + d.to_string() }); } else { b.add_css_class("success");