From 89cd2e4d009dbe07312ed7fa37926aad9be6fcb5 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Fri, 15 Mar 2024 22:40:06 +0000 Subject: [PATCH 1/2] Fix `Solid` nickname color --- src/theme/text.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/theme/text.rs b/src/theme/text.rs index 28d15c1ee..5daaa315a 100644 --- a/src/theme/text.rs +++ b/src/theme/text.rs @@ -1,7 +1,8 @@ -use super::Theme; use data::theme::{alpha, randomize_color}; use iced::widget::text::{Appearance, DefaultStyle}; +use super::Theme; + impl DefaultStyle for Theme { fn default_style(&self) -> Appearance { none(self) @@ -49,6 +50,17 @@ pub fn transparent(theme: &Theme) -> Appearance { } pub fn nickname(theme: &Theme, seed: Option, transparent: bool) -> Appearance { + let dark_theme = theme.colors().is_dark_theme(); + + if seed.is_none() { + let color = match transparent { + true => theme.colors().text.med_alpha, + false => theme.colors().text.base, + }; + + return Appearance { color: Some(color) }; + } + let original_color = theme.colors().action.base; let randomized_color = seed .as_deref() @@ -56,7 +68,6 @@ pub fn nickname(theme: &Theme, seed: Option, transparent: bool) -> Appea .unwrap_or_else(|| original_color); let color = if transparent { - let dark_theme = theme.colors().is_dark_theme(); alpha(randomized_color, if dark_theme { 0.2 } else { 0.4 }) } else { randomized_color From b85b4aa7dadfcd0c7e2db903b2b7bd05563dfa2b Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Mon, 18 Mar 2024 09:54:10 +0000 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index da1d600fc..5507536cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Unreleased +Changed: + +- Use primary text color instead of accent color for `Solid` nicknames + # 2024.4 (2024-03-15) Added: