diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2022-04-09 03:33:56 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2022-04-09 03:33:56 -0400 |
commit | d36fe4d0e9f7e537adc73827b925c429cd1f6ba8 (patch) | |
tree | 3c1679c477f20f0677dd1a7cd154b05af5e1ab27 /src/components/channeltabswitcherhandy.hpp | |
parent | 44317e2d349acb859821691801692c87433c1b83 (diff) | |
download | abaddon-portaudio-d36fe4d0e9f7e537adc73827b925c429cd1f6ba8.tar.gz abaddon-portaudio-d36fe4d0e9f7e537adc73827b925c429cd1f6ba8.zip |
add server icons to channels
Diffstat (limited to 'src/components/channeltabswitcherhandy.hpp')
-rw-r--r-- | src/components/channeltabswitcherhandy.hpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/components/channeltabswitcherhandy.hpp b/src/components/channeltabswitcherhandy.hpp index bc38091..6a2dbff 100644 --- a/src/components/channeltabswitcherhandy.hpp +++ b/src/components/channeltabswitcherhandy.hpp @@ -6,6 +6,8 @@ #include <handy.h> #include "discord/snowflake.hpp" +class ChannelData; + // thin wrapper over c api // HdyTabBar + invisible HdyTabView since it needs one class ChannelTabSwitcherHandy : public Gtk::Box { @@ -20,6 +22,8 @@ public: private: void CheckUnread(Snowflake id); void ClearPage(HdyTabPage *page); + void OnPageIconLoad(HdyTabPage *page, const Glib::RefPtr<Gdk::Pixbuf> &pb); + void CheckPageIcon(HdyTabPage *page, const ChannelData &data); HdyTabBar *m_tab_bar; Gtk::Widget *m_tab_bar_wrapped; @@ -28,6 +32,8 @@ private: std::unordered_map<Snowflake, HdyTabPage *> m_pages; std::unordered_map<HdyTabPage *, Snowflake> m_pages_rev; + // need to hold a reference to the pixbuf data + std::unordered_map<HdyTabPage *, Glib::RefPtr<Gdk::Pixbuf>> m_page_icons; friend void selected_page_notify_cb(HdyTabView *, GParamSpec *, ChannelTabSwitcherHandy *); friend gboolean close_page_cb(HdyTabView *, HdyTabPage *, ChannelTabSwitcherHandy *); |