diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-02-09 16:47:17 -0500 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-02-09 16:47:17 -0500 |
commit | aaef45752648ff5d99ebac3a11341da9a2b95aaf (patch) | |
tree | 2c36627a43a20e103b0ae5573332b21f7c40dc1e /components | |
parent | 2ddac42575aee5370d01701ce50444713d4d44b9 (diff) | |
download | abaddon-portaudio-aaef45752648ff5d99ebac3a11341da9a2b95aaf.tar.gz abaddon-portaudio-aaef45752648ff5d99ebac3a11341da9a2b95aaf.zip |
show status indicator in dm list, handle (some of) READY_SUPPLEMENTAL
Diffstat (limited to 'components')
-rw-r--r-- | components/channels.cpp | 6 | ||||
-rw-r--r-- | components/channels.hpp | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/components/channels.cpp b/components/channels.cpp index 391a1a1..cd5fee9 100644 --- a/components/channels.cpp +++ b/components/channels.cpp @@ -5,6 +5,7 @@ #include "../abaddon.hpp" #include "../imgmanager.hpp" #include "../util.hpp" +#include "statusindicator.hpp" void ChannelListRow::Collapse() {} @@ -61,6 +62,9 @@ ChannelListRowDMChannel::ChannelListRowDMChannel(const ChannelData *data) { top_recipient = recipients[0]; if (data->Type == ChannelType::DM) { + m_status = Gtk::manage(new StatusIndicator(top_recipient.ID)); + m_status->set_margin_start(5); + if (top_recipient.HasAvatar()) { m_icon = Gtk::manage(new Gtk::Image(Abaddon::Get().GetImageManager().GetPlaceholder(24))); auto cb = [this](const Glib::RefPtr<Gdk::Pixbuf> &pb) { @@ -82,6 +86,8 @@ ChannelListRowDMChannel::ChannelListRowDMChannel(const ChannelData *data) { m_box->set_halign(Gtk::ALIGN_START); if (m_icon != nullptr) m_box->pack_start(*m_icon); + if (m_status != nullptr) + m_box->pack_start(*m_status); m_box->pack_start(*m_lbl); m_ev->add(*m_box); add(*m_ev); diff --git a/components/channels.hpp b/components/channels.hpp index f537043..d7fda18 100644 --- a/components/channels.hpp +++ b/components/channels.hpp @@ -33,6 +33,7 @@ protected: Gtk::Label *m_lbl; }; +class StatusIndicator; class ChannelListRowDMChannel : public ChannelListRow { public: ChannelListRowDMChannel(const ChannelData *data); @@ -40,6 +41,7 @@ public: protected: Gtk::EventBox *m_ev; Gtk::Box *m_box; + StatusIndicator *m_status = nullptr; Gtk::TextView *m_lbl; Gtk::Image *m_icon = nullptr; }; |