diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2022-01-28 14:46:33 -0500 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2022-01-28 14:46:33 -0500 |
commit | ce238d08e96aafc956b5ecd7cf00796a227c5666 (patch) | |
tree | 81a2ab3506a6c4dcc52f84a21e4bf59db9f43267 | |
parent | f9864a24ed92fd06076bb456b498575940b758fd (diff) | |
download | abaddon-portaudio-ce238d08e96aafc956b5ecd7cf00796a227c5666.tar.gz abaddon-portaudio-ce238d08e96aafc956b5ecd7cf00796a227c5666.zip |
add style option for unread indicator color
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | src/components/channelscellrenderer.cpp | 12 | ||||
-rw-r--r-- | src/settings.cpp | 2 | ||||
-rw-r--r-- | src/settings.hpp | 1 |
4 files changed, 12 insertions, 4 deletions
@@ -213,6 +213,7 @@ For example, memory_db would be set by adding `memory_db = true` under the line * channelcolor (string) - color to use for SFW channels in the channel list * mentionbadgecolor (string) - background color for mention badges * mentionbadgetextcolor (string) - color to use for number displayed on mention badges +* unreadcolor (string) - color to use for the unread indicator ### Environment variables diff --git a/src/components/channelscellrenderer.cpp b/src/components/channelscellrenderer.cpp index 1f7b6a7..e657ed3 100644 --- a/src/components/channelscellrenderer.cpp +++ b/src/components/channelscellrenderer.cpp @@ -258,7 +258,8 @@ void CellRendererChannels::render_vfunc_guild(const Cairo::RefPtr<Cairo::Context const auto has_unread = discord.GetUnreadStateForGuild(id, total_mentions); if (has_unread && !discord.IsGuildMuted(id)) { - cr->set_source_rgb(1.0, 1.0, 1.0); + static const auto color = Gdk::RGBA(Abaddon::Get().GetSettings().UnreadIndicatorColor); + cr->set_source_rgb(color.get_red(), color.get_green(), color.get_blue()); const auto x = background_area.get_x(); const auto y = background_area.get_y(); const auto w = background_area.get_width(); @@ -403,7 +404,8 @@ void CellRendererChannels::render_vfunc_channel(const Cairo::RefPtr<Cairo::Conte if (unread_state < 0) return; if (!is_muted) { - cr->set_source_rgb(1.0, 1.0, 1.0); + static const auto color = Gdk::RGBA(Abaddon::Get().GetSettings().UnreadIndicatorColor); + cr->set_source_rgb(color.get_red(), color.get_green(), color.get_blue()); const auto x = background_area.get_x(); const auto y = background_area.get_y(); const auto w = background_area.get_width(); @@ -474,7 +476,8 @@ void CellRendererChannels::render_vfunc_thread(const Cairo::RefPtr<Cairo::Contex if (unread_state < 0) return; if (!is_muted) { - cr->set_source_rgb(1.0, 1.0, 1.0); + static const auto color = Gdk::RGBA(Abaddon::Get().GetSettings().UnreadIndicatorColor); + cr->set_source_rgb(color.get_red(), color.get_green(), color.get_blue()); const auto x = background_area.get_x(); const auto y = background_area.get_y(); const auto w = background_area.get_width(); @@ -614,7 +617,8 @@ void CellRendererChannels::render_vfunc_dm(const Cairo::RefPtr<Cairo::Context> & if (unread_state < 0) return; if (!is_muted) { - cr->set_source_rgb(1.0, 1.0, 1.0); + static const auto color = Gdk::RGBA(Abaddon::Get().GetSettings().UnreadIndicatorColor); + cr->set_source_rgb(color.get_red(), color.get_green(), color.get_blue()); const auto x = background_area.get_x(); const auto y = background_area.get_y(); const auto w = background_area.get_width(); diff --git a/src/settings.cpp b/src/settings.cpp index 9435999..242bd7c 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -56,6 +56,7 @@ void SettingsManager::ReadSettings() { SMSTR("style", "channelcolor", ChannelColor); SMSTR("style", "mentionbadgecolor", MentionBadgeColor); SMSTR("style", "mentionbadgetextcolor", MentionBadgeTextColor); + SMSTR("style", "unreadcolor", UnreadIndicatorColor); #undef SMBOOL #undef SMSTR @@ -108,6 +109,7 @@ void SettingsManager::Close() { SMSTR("style", "channelcolor", ChannelColor); SMSTR("style", "mentionbadgecolor", MentionBadgeColor); SMSTR("style", "mentionbadgetextcolor", MentionBadgeTextColor); + SMSTR("style", "unreadcolor", UnreadIndicatorColor); #undef SMSTR #undef SMBOOL diff --git a/src/settings.hpp b/src/settings.hpp index 2f48248..52b20b9 100644 --- a/src/settings.hpp +++ b/src/settings.hpp @@ -40,6 +40,7 @@ public: std::string ChannelColor { "#fbfbfb" }; std::string MentionBadgeColor { "#b82525" }; std::string MentionBadgeTextColor { "#fbfbfb" }; + std::string UnreadIndicatorColor { "#ffffff" }; }; SettingsManager(const std::string &filename); |