1
0
mirror of https://github.com/uowuo/abaddon.git synced 2025-03-04 03:03:16 -05:00

remove channel color style setting

This commit is contained in:
ouwou 2023-12-15 22:06:16 -05:00
parent 19282c8642
commit 0187e69584
3 changed files with 3 additions and 57 deletions

View File

@ -258,14 +258,11 @@ void CellRendererChannels::render_vfunc_folder(const Cairo::RefPtr<Cairo::Contex
Gdk::Rectangle text_cell_area(text_x, text_y, text_w, text_h);
static const auto color = Gdk::RGBA(Abaddon::Get().GetSettings().ChannelColor);
if (m_property_color.get_value().has_value()) {
// m_renderer_text.property_foreground_rgba() = *m_property_color.get_value();
} else {
// m_renderer_text.property_foreground_rgba() = color;
m_renderer_text.property_foreground_rgba() = *m_property_color.get_value();
}
m_renderer_text.render(cr, widget, background_area, text_cell_area, flags);
// m_renderer_text.property_foreground_set() = false;
m_renderer_text.property_foreground_set() = false;
}
// guild functions
@ -342,8 +339,6 @@ void CellRendererChannels::render_vfunc_guild(const Cairo::RefPtr<Cairo::Context
static_cast<int>(text_w),
static_cast<int>(text_h));
static const auto color = Gdk::RGBA(Abaddon::Get().GetSettings().ChannelColor);
// m_renderer_text.property_foreground_rgba() = color;
m_renderer_text.render(cr, widget, background_area, text_cell_area, flags);
const bool hover_only = Abaddon::Get().GetSettings().AnimatedGuildHoverOnly;
@ -435,23 +430,14 @@ void CellRendererChannels::render_vfunc_category(const Cairo::RefPtr<Cairo::Cont
Gdk::Rectangle text_cell_area(text_x, text_y, text_w, text_h);
static const auto color = Gdk::RGBA(Abaddon::Get().GetSettings().ChannelColor);
auto &discord = Abaddon::Get().GetDiscordClient();
const auto id = m_property_id.get_value();
if (discord.IsChannelMuted(m_property_id.get_value())) {
auto muted = color;
muted.set_red(muted.get_red() * 0.5);
muted.set_green(muted.get_green() * 0.5);
muted.set_blue(muted.get_blue() * 0.5);
// m_renderer_text.property_foreground_rgba() = muted;
} else {
if (!discord.IsChannelMuted(m_property_id.get_value())) {
if (discord.GetUnreadChannelsCountForCategory(id) > 0) {
AddUnreadIndicator(cr, background_area);
}
// m_renderer_text.property_foreground_rgba() = color;
}
m_renderer_text.render(cr, widget, background_area, text_cell_area, flags);
// m_renderer_text.property_foreground_set() = false;
}
// text channel
@ -487,20 +473,7 @@ void CellRendererChannels::render_vfunc_channel(const Cairo::RefPtr<Cairo::Conte
const auto id = m_property_id.get_value();
const bool is_muted = discord.IsChannelMuted(id);
static const auto sfw_unmuted = Gdk::RGBA(Abaddon::Get().GetSettings().ChannelColor);
static const auto nsfw_color = Gdk::RGBA(Abaddon::Get().GetSettings().NSFWChannelColor);
/* if (m_property_nsfw.get_value())
// m_renderer_text.property_foreground_rgba() = nsfw_color;
else
// m_renderer_text.property_foreground_rgba() = sfw_unmuted;
if (is_muted) {
auto col = // m_renderer_text.property_foreground_rgba().get_value();
col.set_red(col.get_red() * 0.5);
col.set_green(col.get_green() * 0.5);
col.set_blue(col.get_blue() * 0.5);
// m_renderer_text.property_foreground_rgba() = col;
}*/
if (is_muted) {
auto color = widget.get_style_context()->get_color(Gtk::STATE_FLAG_NORMAL);
@ -509,8 +482,6 @@ void CellRendererChannels::render_vfunc_channel(const Cairo::RefPtr<Cairo::Conte
}
m_renderer_text.render(cr, widget, background_area, text_cell_area, flags);
m_renderer_text.property_foreground_set() = false;
// unset foreground to default so properties dont bleed
// m_renderer_text.property_foreground_set() = false;
// unread
if (!Abaddon::Get().GetSettings().Unreads) return;
@ -564,18 +535,7 @@ void CellRendererChannels::render_vfunc_thread(const Cairo::RefPtr<Cairo::Contex
const auto id = m_property_id.get_value();
const bool is_muted = discord.IsChannelMuted(id);
static const auto color = Gdk::RGBA(Abaddon::Get().GetSettings().ChannelColor);
if (Abaddon::Get().GetDiscordClient().IsChannelMuted(m_property_id.get_value())) {
auto muted = color;
muted.set_red(muted.get_red() * 0.5);
muted.set_green(muted.get_green() * 0.5);
muted.set_blue(muted.get_blue() * 0.5);
// m_renderer_text.property_foreground_rgba() = muted;
} else {
// m_renderer_text.property_foreground_rgba() = color;
}
m_renderer_text.render(cr, widget, background_area, text_cell_area, flags);
// m_renderer_text.property_foreground_set() = false;
// unread
if (!Abaddon::Get().GetSettings().Unreads) return;
@ -857,18 +817,7 @@ void CellRendererChannels::render_vfunc_dm(const Cairo::RefPtr<Cairo::Context> &
const auto id = m_property_id.get_value();
const bool is_muted = discord.IsChannelMuted(id);
static const auto color = Gdk::RGBA(Abaddon::Get().GetSettings().ChannelColor);
if (Abaddon::Get().GetDiscordClient().IsChannelMuted(m_property_id.get_value())) {
auto muted = color;
muted.set_red(muted.get_red() * 0.5);
muted.set_green(muted.get_green() * 0.5);
muted.set_blue(muted.get_blue() * 0.5);
// m_renderer_text.property_foreground_rgba() = muted;
} else {
// m_renderer_text.property_foreground_rgba() = color;
}
m_renderer_text.render(cr, widget, background_area, text_cell_area, flags);
// m_renderer_text.property_foreground_set() = false;
Gdk::Cairo::set_source_pixbuf(cr, m_property_pixbuf.get_value(), icon_x, icon_y);
cr->rectangle(icon_x, icon_y, icon_w, icon_h);

View File

@ -69,7 +69,6 @@ void SettingsManager::ReadSettings() {
SMSTR("http", "user_agent", UserAgent);
SMSTR("style", "expandercolor", ChannelsExpanderColor);
SMSTR("style", "nsfwchannelcolor", NSFWChannelColor);
SMSTR("style", "channelcolor", ChannelColor);
SMSTR("style", "mentionbadgecolor", MentionBadgeColor);
SMSTR("style", "mentionbadgetextcolor", MentionBadgeTextColor);
SMSTR("style", "unreadcolor", UnreadIndicatorColor);
@ -159,7 +158,6 @@ void SettingsManager::Close() {
SMSTR("http", "user_agent", UserAgent);
SMSTR("style", "expandercolor", ChannelsExpanderColor);
SMSTR("style", "nsfwchannelcolor", NSFWChannelColor);
SMSTR("style", "channelcolor", ChannelColor);
SMSTR("style", "mentionbadgecolor", MentionBadgeColor);
SMSTR("style", "mentionbadgetextcolor", MentionBadgeTextColor);
SMSTR("style", "unreadcolor", UnreadIndicatorColor);

View File

@ -40,7 +40,6 @@ public:
// [style]
std::string ChannelsExpanderColor { "rgba(255, 83, 112, 0)" };
std::string NSFWChannelColor { "#ed6666" };
std::string ChannelColor { "#fbfbfb" };
std::string MentionBadgeColor { "#b82525" };
std::string MentionBadgeTextColor { "#fbfbfb" };
std::string UnreadIndicatorColor { "#ffffff" };