1use bpro::HistoryEntry;
13use gtk::{gdk, MessageType};
14
15#[derive(Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug)]
16pub struct Notification {
17 pub msg: String,
18 pub ty: MessageType,
19}
20
21pub trait UI {
22 fn color(&self) -> gdk::RGBA;
23}
24
25impl UI for HistoryEntry {
26 fn color(&self) -> gdk::RGBA {
27 match self.balance() {
28 x if x > 0 => gdk::RGBA::new(38.0 / 256.0, 162.0 / 256.0, 105.0 / 256.0, 1.0),
29 x if x < 0 => gdk::RGBA::new(165.0 / 256.0, 29.0 / 256.0, 45.0 / 256.0, 1.0),
30 0 => gdk::RGBA::new(119.0 / 256.0, 118.0 / 256.0, 123.0 / 256.0, 1.0),
31 _ => unreachable!(),
32 }
33 }
34}