forked from OpenGamers/abaddon
add setting to not show unread stuff
This commit is contained in:
@@ -249,6 +249,7 @@ void CellRendererChannels::render_vfunc_guild(const Cairo::RefPtr<Cairo::Context
|
|||||||
}
|
}
|
||||||
|
|
||||||
// unread
|
// unread
|
||||||
|
if (!Abaddon::Get().GetSettings().Unreads) return;
|
||||||
|
|
||||||
const auto id = m_property_id.get_value();
|
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;
|
m_renderer_text.property_foreground_set() = false;
|
||||||
|
|
||||||
// unread
|
// unread
|
||||||
|
if (!Abaddon::Get().GetSettings().Unreads) return;
|
||||||
|
|
||||||
const auto unread_state = discord.GetUnreadStateForChannel(id);
|
const auto unread_state = discord.GetUnreadStateForChannel(id);
|
||||||
if (unread_state < 0) return;
|
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;
|
m_renderer_text.property_foreground_set() = false;
|
||||||
|
|
||||||
// unread
|
// unread
|
||||||
|
if (!Abaddon::Get().GetSettings().Unreads) return;
|
||||||
|
|
||||||
const auto unread_state = discord.GetUnreadStateForChannel(id);
|
const auto unread_state = discord.GetUnreadStateForChannel(id);
|
||||||
if (unread_state < 0) return;
|
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());
|
cell_area.get_width(), cell_area.get_height());
|
||||||
m_renderer_text.render(cr, widget, background_area, text_cell_area, flags);
|
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()));
|
auto *paned = static_cast<Gtk::Paned *>(widget.get_ancestor(Gtk::Paned::get_type()));
|
||||||
if (paned != nullptr) {
|
if (paned != nullptr) {
|
||||||
const auto edge = std::min(paned->get_position(), background_area.get_width());
|
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();
|
cr->fill();
|
||||||
|
|
||||||
// unread
|
// unread
|
||||||
|
if (!Abaddon::Get().GetSettings().Unreads) return;
|
||||||
|
|
||||||
const auto unread_state = discord.GetUnreadStateForChannel(id);
|
const auto unread_state = discord.GetUnreadStateForChannel(id);
|
||||||
if (unread_state < 0) return;
|
if (unread_state < 0) return;
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ void SettingsManager::ReadSettings() {
|
|||||||
SMBOOL("gui", "owner_crown", ShowOwnerCrown);
|
SMBOOL("gui", "owner_crown", ShowOwnerCrown);
|
||||||
SMBOOL("gui", "save_state", SaveState);
|
SMBOOL("gui", "save_state", SaveState);
|
||||||
SMBOOL("gui", "stock_emojis", ShowStockEmojis);
|
SMBOOL("gui", "stock_emojis", ShowStockEmojis);
|
||||||
|
SMBOOL("gui", "unreads", Unreads);
|
||||||
SMINT("http", "concurrent", CacheHTTPConcurrency);
|
SMINT("http", "concurrent", CacheHTTPConcurrency);
|
||||||
SMSTR("http", "user_agent", UserAgent);
|
SMSTR("http", "user_agent", UserAgent);
|
||||||
SMSTR("style", "expandercolor", ChannelsExpanderColor);
|
SMSTR("style", "expandercolor", ChannelsExpanderColor);
|
||||||
@@ -98,6 +99,7 @@ void SettingsManager::Close() {
|
|||||||
SMBOOL("gui", "owner_crown", ShowOwnerCrown);
|
SMBOOL("gui", "owner_crown", ShowOwnerCrown);
|
||||||
SMBOOL("gui", "save_state", SaveState);
|
SMBOOL("gui", "save_state", SaveState);
|
||||||
SMBOOL("gui", "stock_emojis", ShowStockEmojis);
|
SMBOOL("gui", "stock_emojis", ShowStockEmojis);
|
||||||
|
SMBOOL("gui", "unreads", Unreads);
|
||||||
SMINT("http", "concurrent", CacheHTTPConcurrency);
|
SMINT("http", "concurrent", CacheHTTPConcurrency);
|
||||||
SMSTR("http", "user_agent", UserAgent);
|
SMSTR("http", "user_agent", UserAgent);
|
||||||
SMSTR("style", "expandercolor", ChannelsExpanderColor);
|
SMSTR("style", "expandercolor", ChannelsExpanderColor);
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ public:
|
|||||||
#else
|
#else
|
||||||
bool ShowStockEmojis { true };
|
bool ShowStockEmojis { true };
|
||||||
#endif
|
#endif
|
||||||
|
bool Unreads { true };
|
||||||
|
|
||||||
// [http]
|
// [http]
|
||||||
int CacheHTTPConcurrency { 20 };
|
int CacheHTTPConcurrency { 20 };
|
||||||
|
|||||||
Reference in New Issue
Block a user