Files
abaddon/src/components/memberlist.hpp
Dylam De La Torre a51a54bc59 Restructure source and resource files (#46)
importantly, res is now res/res and css is now res/css
2021-11-23 04:21:56 +00:00

45 lines
945 B
C++

#pragma once
#include <gtkmm.h>
#include <mutex>
#include <unordered_map>
#include <optional>
#include "discord/discord.hpp"
class LazyImage;
class StatusIndicator;
class MemberListUserRow : public Gtk::ListBoxRow {
public:
MemberListUserRow(const std::optional<GuildData> &guild, const UserData &data);
Snowflake ID;
private:
Gtk::EventBox *m_ev;
Gtk::Box *m_box;
LazyImage *m_avatar;
StatusIndicator *m_status_indicator;
Gtk::Label *m_label;
Gtk::Image *m_crown = nullptr;
};
class MemberList {
public:
MemberList();
Gtk::Widget *GetRoot() const;
void UpdateMemberList();
void Clear();
void SetActiveChannel(Snowflake id);
private:
void AttachUserMenuHandler(Gtk::ListBoxRow *row, Snowflake id);
Gtk::ScrolledWindow *m_main;
Gtk::ListBox *m_listbox;
Snowflake m_guild_id;
Snowflake m_chan_id;
std::unordered_map<Snowflake, Gtk::ListBoxRow *> m_id_to_row;
};