diff --git a/crates/client/src/gui.rs b/crates/client/src/gui.rs index 8aa4814..6725f58 100644 --- a/crates/client/src/gui.rs +++ b/crates/client/src/gui.rs @@ -656,6 +656,7 @@ impl Yumush { self.request_user_avatar(&user, cx); self.chat.muted = mutes::load(user.id); style::remember(&[&user]); + style::remember_me(user.id); self.user = Some(user); self.change_page(Route::Chat, window, cx); self.load_communities(window, cx); diff --git a/crates/client/src/gui/parts.rs b/crates/client/src/gui/parts.rs index 073fb33..c62a2d3 100644 --- a/crates/client/src/gui/parts.rs +++ b/crates/client/src/gui/parts.rs @@ -148,7 +148,7 @@ pub fn toggle( flip: impl Fn(&mut Window, &mut App) + 'static, ) -> Stateful
{ let (bar, knob, left) = if on { - (t.hue(common::model::Hue::Amber), t.paper(), 20.) + (t.hue(super::style::my_hue()), t.paper(), 20.) } else { (t.faint(), t.faint(), 0.) }; diff --git a/crates/client/src/gui/style.rs b/crates/client/src/gui/style.rs index bed6a52..511d36c 100644 --- a/crates/client/src/gui/style.rs +++ b/crates/client/src/gui/style.rs @@ -113,6 +113,15 @@ thread_local! { static CHOSEN: RefCell> = RefCell::default(); static AVATAR: RefCell> = RefCell::default(); static PICTURED: RefCell> = RefCell::default(); + static ME: std::cell::Cell> = const { std::cell::Cell::new(None) }; +} + +pub fn remember_me(id: Id) { + ME.set(Some(id)); +} + +pub fn my_hue() -> Hue { + ME.get().map(hue_of).unwrap_or(Hue::Amber) } pub fn remember(users: &[&User]) {