From af567847970121765674dc8d0542b9c4a1f89ed1 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Sun, 5 Dec 2021 03:57:26 -0500 Subject: basic unread indicators for channels --- src/components/unreadrenderer.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/components/unreadrenderer.cpp (limited to 'src/components/unreadrenderer.cpp') diff --git a/src/components/unreadrenderer.cpp b/src/components/unreadrenderer.cpp new file mode 100644 index 0000000..4e508fc --- /dev/null +++ b/src/components/unreadrenderer.cpp @@ -0,0 +1,15 @@ +#include "unreadrenderer.hpp" +#include "abaddon.hpp" + +void UnreadRenderer::RenderUnreadOnChannel(Snowflake id, const Cairo::RefPtr &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(); + } +} -- cgit v1.2.3