diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2023-10-16 21:31:28 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2023-10-16 21:31:28 -0400 |
commit | 3e0cd83dd6026dc701c548dc40b41f5accbc29db (patch) | |
tree | 6a51464a60c7fe5947924f486d256f99475228fe /src/components/channellist/classic/guildlist.cpp | |
parent | 1895a8f133e070f63680eacbaffaecf192bd608b (diff) | |
download | abaddon-portaudio-3e0cd83dd6026dc701c548dc40b41f5accbc29db.tar.gz abaddon-portaudio-3e0cd83dd6026dc701c548dc40b41f5accbc29db.zip |
start channel list refactor for server list
Diffstat (limited to 'src/components/channellist/classic/guildlist.cpp')
-rw-r--r-- | src/components/channellist/classic/guildlist.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/components/channellist/classic/guildlist.cpp b/src/components/channellist/classic/guildlist.cpp new file mode 100644 index 0000000..0d5737b --- /dev/null +++ b/src/components/channellist/classic/guildlist.cpp @@ -0,0 +1,23 @@ +#include "guildlist.hpp" +#include "guildlistfolderitem.hpp" + +GuildList::GuildList() { + set_selection_mode(Gtk::SELECTION_NONE); + show_all_children(); +} + +void GuildList::AddGuild(Snowflake id) { + const auto guild = Abaddon::Get().GetDiscordClient().GetGuild(id); + if (!guild.has_value()) return; + + auto *item = Gtk::make_managed<GuildListGuildItem>(*guild); + item->show(); + add(*item); +} + +void GuildList::Clear() { + const auto children = get_children(); + for (auto child : children) { + delete child; + } +} |