mirror of
https://github.com/celisej567/abaddon.git
synced 2026-09-19 20:11:59 +03:00
start channel list refactor for server list
This commit is contained in:
23
src/components/channellist/classic/guildlist.cpp
Normal file
23
src/components/channellist/classic/guildlist.cpp
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user