summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2020-11-01 00:13:52 -0400
committerouwou <26526779+ouwou@users.noreply.github.com>2020-11-01 00:13:52 -0400
commitec8117a24b129b957a45f6f142221143b0f059a0 (patch)
tree848b71a0ab01a387ab2cc20b2d61f679ccff2697 /components
parent90ea3c55cc81faf223e203208d95d1fa06ca6dbf (diff)
downloadabaddon-portaudio-ec8117a24b129b957a45f6f142221143b0f059a0.tar.gz
abaddon-portaudio-ec8117a24b129b957a45f6f142221143b0f059a0.zip
update channel list selection when channel mention is clicked
Diffstat (limited to 'components')
-rw-r--r--components/channels.cpp6
-rw-r--r--components/channels.hpp2
2 files changed, 8 insertions, 0 deletions
diff --git a/components/channels.cpp b/components/channels.cpp
index fc409ad..a8f2f66 100644
--- a/components/channels.cpp
+++ b/components/channels.cpp
@@ -414,6 +414,12 @@ void ChannelList::Clear() {
m_update_dispatcher.emit();
}
+void ChannelList::SetActiveChannel(Snowflake id) {
+ auto it = m_id_to_row.find(id);
+ if (it == m_id_to_row.end()) return;
+ m_list->select_row(*it->second);
+}
+
void ChannelList::CollapseRow(ChannelListRow *row) {
row->Collapse();
for (auto child : row->Children) {
diff --git a/components/channels.hpp b/components/channels.hpp
index 6c6997a..012891f 100644
--- a/components/channels.hpp
+++ b/components/channels.hpp
@@ -94,6 +94,8 @@ public:
void UpdateGuild(Snowflake id);
void Clear();
+ void SetActiveChannel(Snowflake id);
+
protected:
Gtk::ListBox *m_list;
Gtk::ScrolledWindow *m_main;