mirror of
https://github.com/uowuo/abaddon.git
synced 2024-11-10 06:00:10 +00:00
add open chat to voice channels
This commit is contained in:
parent
e6b4871df3
commit
f8de54e47e
@ -29,6 +29,7 @@ ChannelListTree::ChannelListTree()
|
||||
#ifdef WITH_VOICE
|
||||
, m_menu_voice_channel_join("_Join", true)
|
||||
, m_menu_voice_channel_disconnect("_Disconnect", true)
|
||||
, m_menu_voice_open_chat("Open _Chat", true)
|
||||
#endif
|
||||
, m_menu_dm_copy_id("_Copy ID", true)
|
||||
, m_menu_dm_close("") // changes depending on if group or not
|
||||
@ -209,8 +210,14 @@ ChannelListTree::ChannelListTree()
|
||||
m_signal_action_disconnect_voice.emit();
|
||||
});
|
||||
|
||||
m_menu_voice_open_chat.signal_activate().connect([this]() {
|
||||
const auto id = static_cast<Snowflake>((*m_model->get_iter(m_path_for_menu))[m_columns.m_id]);
|
||||
m_signal_action_channel_item_select.emit(id);
|
||||
});
|
||||
|
||||
m_menu_voice_channel.append(m_menu_voice_channel_join);
|
||||
m_menu_voice_channel.append(m_menu_voice_channel_disconnect);
|
||||
m_menu_voice_channel.append(m_menu_voice_open_chat);
|
||||
m_menu_voice_channel.show_all();
|
||||
#endif
|
||||
|
||||
@ -1172,8 +1179,11 @@ bool ChannelListTree::SelectionFunc(const Glib::RefPtr<Gtk::TreeModel> &model, c
|
||||
}
|
||||
}
|
||||
|
||||
auto type = (*model->get_iter(path))[m_columns.m_type];
|
||||
return type == RenderType::TextChannel || type == RenderType::DM || type == RenderType::Thread;
|
||||
const auto type = (*model->get_iter(path))[m_columns.m_type];
|
||||
const auto id = static_cast<Snowflake>((*model->get_iter(path))[m_columns.m_id]);
|
||||
// todo maybe just keep this last check?
|
||||
if (type == RenderType::TextChannel || type == RenderType::DM || type == RenderType::Thread || (id == m_active_channel)) return true;
|
||||
return is_currently_selected;
|
||||
}
|
||||
|
||||
void ChannelListTree::AddPrivateChannels() {
|
||||
|
@ -166,6 +166,7 @@ protected:
|
||||
Gtk::Menu m_menu_voice_channel;
|
||||
Gtk::MenuItem m_menu_voice_channel_join;
|
||||
Gtk::MenuItem m_menu_voice_channel_disconnect;
|
||||
Gtk::MenuItem m_menu_voice_open_chat;
|
||||
#endif
|
||||
|
||||
Gtk::Menu m_menu_dm;
|
||||
|
Loading…
Reference in New Issue
Block a user