basic unread indicators for channels

This commit is contained in:
ouwou committed 2021-12-05 03:57:26 -05:00
1 parent 2461406887
commit af56784797
10 files changed
+174 -10

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
#include "unreadrenderer.hpp"
#include "abaddon.hpp"
void UnreadRenderer::RenderUnreadOnChannel(Snowflake id, const Cairo::RefPtr<Cairo::Context> &cr, const Gdk::Rectangle &background_area, const Gdk::Rectangle &cell_area) {
const auto state = Abaddon::Get().GetDiscordClient().GetUnreadStateForChannel(id);
if (state >= 0) {
cr->set_source_rgb(1.0, 1.0, 1.0);
const auto x = cell_area.get_x() + 1;
const auto y = cell_area.get_y();
const auto w = cell_area.get_width();
const auto h = cell_area.get_height();
cr->rectangle(x, y, 3, h);
cr->fill();
}
}