start channel list refactor for server list

This commit is contained in:
ouwou
2023-10-16 21:31:28 -04:00
parent 1895a8f133
commit 3e0cd83dd6
12 changed files with 152 additions and 67 deletions

View File

@@ -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;
}
}