pull out chat list into a separate component

This commit is contained in:
ouwou
2021-05-24 01:42:04 -04:00
parent a1c7d14efa
commit b2655260fa
11 changed files with 429 additions and 271 deletions

View File

@@ -1217,7 +1217,11 @@ std::vector<Gtk::Widget *> ChatMessageHeader::GetChildContent() {
void ChatMessageHeader::AttachUserMenuHandler(Gtk::Widget &widget) {
widget.signal_button_press_event().connect([this](GdkEventButton *ev) -> bool {
if (ev->type == GDK_BUTTON_PRESS && ev->button == GDK_BUTTON_SECONDARY) {
m_signal_action_open_user_menu.emit(reinterpret_cast<GdkEvent *>(ev));
auto info = Abaddon::Get().GetDiscordClient().GetChannel(ChannelID);
Snowflake guild_id;
if (info.has_value() && info->GuildID.has_value())
guild_id = *info->GuildID;
Abaddon::Get().ShowUserMenu(reinterpret_cast<GdkEvent *>(ev), UserID, guild_id);
return true;
}