diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-12-05 03:57:26 -0500 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-12-05 03:57:26 -0500 |
commit | af567847970121765674dc8d0542b9c4a1f89ed1 (patch) | |
tree | a67af688c82fb3e49fee9fe60d5ab69ac2173b20 /src/components/unreadrenderer.cpp | |
parent | 246140688714936820b5c977665ad2a904fa7222 (diff) | |
download | abaddon-portaudio-af567847970121765674dc8d0542b9c4a1f89ed1.tar.gz abaddon-portaudio-af567847970121765674dc8d0542b9c4a1f89ed1.zip |
basic unread indicators for channels
Diffstat (limited to 'src/components/unreadrenderer.cpp')
-rw-r--r-- | src/components/unreadrenderer.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
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<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(); + } +} |