add setting to not show unread stuff

This commit is contained in:
ouwou 2022-01-26 18:44:31 -05:00
parent 7d49f934bc
commit 738d50dd43
3 changed files with 9 additions and 0 deletions

View File

@ -249,6 +249,7 @@ void CellRendererChannels::render_vfunc_guild(const Cairo::RefPtr<Cairo::Context
}
// unread
if (!Abaddon::Get().GetSettings().Unreads) return;
const auto id = m_property_id.get_value();
@ -396,6 +397,7 @@ void CellRendererChannels::render_vfunc_channel(const Cairo::RefPtr<Cairo::Conte
m_renderer_text.property_foreground_set() = false;
// unread
if (!Abaddon::Get().GetSettings().Unreads) return;
const auto unread_state = discord.GetUnreadStateForChannel(id);
if (unread_state < 0) return;
@ -466,6 +468,7 @@ void CellRendererChannels::render_vfunc_thread(const Cairo::RefPtr<Cairo::Contex
m_renderer_text.property_foreground_set() = false;
// unread
if (!Abaddon::Get().GetSettings().Unreads) return;
const auto unread_state = discord.GetUnreadStateForChannel(id);
if (unread_state < 0) return;
@ -514,6 +517,8 @@ void CellRendererChannels::render_vfunc_dmheader(const Cairo::RefPtr<Cairo::Cont
cell_area.get_width(), cell_area.get_height());
m_renderer_text.render(cr, widget, background_area, text_cell_area, flags);
if (!Abaddon::Get().GetSettings().Unreads) return;
auto *paned = static_cast<Gtk::Paned *>(widget.get_ancestor(Gtk::Paned::get_type()));
if (paned != nullptr) {
const auto edge = std::min(paned->get_position(), background_area.get_width());
@ -603,6 +608,7 @@ void CellRendererChannels::render_vfunc_dm(const Cairo::RefPtr<Cairo::Context> &
cr->fill();
// unread
if (!Abaddon::Get().GetSettings().Unreads) return;
const auto unread_state = discord.GetUnreadStateForChannel(id);
if (unread_state < 0) return;

View File

@ -47,6 +47,7 @@ void SettingsManager::ReadSettings() {
SMBOOL("gui", "owner_crown", ShowOwnerCrown);
SMBOOL("gui", "save_state", SaveState);
SMBOOL("gui", "stock_emojis", ShowStockEmojis);
SMBOOL("gui", "unreads", Unreads);
SMINT("http", "concurrent", CacheHTTPConcurrency);
SMSTR("http", "user_agent", UserAgent);
SMSTR("style", "expandercolor", ChannelsExpanderColor);
@ -98,6 +99,7 @@ void SettingsManager::Close() {
SMBOOL("gui", "owner_crown", ShowOwnerCrown);
SMBOOL("gui", "save_state", SaveState);
SMBOOL("gui", "stock_emojis", ShowStockEmojis);
SMBOOL("gui", "unreads", Unreads);
SMINT("http", "concurrent", CacheHTTPConcurrency);
SMSTR("http", "user_agent", UserAgent);
SMSTR("style", "expandercolor", ChannelsExpanderColor);

View File

@ -26,6 +26,7 @@ public:
#else
bool ShowStockEmojis { true };
#endif
bool Unreads { true };
// [http]
int CacheHTTPConcurrency { 20 };