From 3565ec885ef631fbfe86c5b2da287ecce0ddf23b Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Mon, 5 Jul 2021 17:09:19 -0400 Subject: [PATCH] try to fix some weird behavior --- components/channels.cpp | 10 ++++++++-- components/channels.hpp | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/components/channels.cpp b/components/channels.cpp index 361b668..bde5639 100644 --- a/components/channels.cpp +++ b/components/channels.cpp @@ -24,8 +24,9 @@ ChannelList::ChannelList() m_signal_action_channel_item_select.emit(static_cast(row[m_columns.m_id])); } }; - m_view.signal_row_activated().connect(cb); - m_view.signal_row_expanded().connect(sigc::mem_fun(*this, &ChannelList::OnRowExpanded)); + m_view.signal_row_activated().connect(cb, false); + m_view.signal_row_collapsed().connect(sigc::mem_fun(*this, &ChannelList::OnRowCollapsed), false); + m_view.signal_row_expanded().connect(sigc::mem_fun(*this, &ChannelList::OnRowExpanded), false); m_view.set_activate_on_single_click(true); m_view.set_hexpand(true); @@ -301,6 +302,11 @@ bool ChannelList::IsTextChannel(ChannelType type) { return type == ChannelType::GUILD_TEXT || type == ChannelType::GUILD_NEWS; } +// this should be unncessary but something is behaving strange so its just in case +void ChannelList::OnRowCollapsed(const Gtk::TreeModel::iterator &iter, const Gtk::TreeModel::Path &path) { + (*iter)[m_columns.m_expanded] = false; +} + void ChannelList::OnRowExpanded(const Gtk::TreeModel::iterator &iter, const Gtk::TreeModel::Path &path) { // restore previous expansion for (auto it = iter->children().begin(); it != iter->children().end(); it++) { diff --git a/components/channels.hpp b/components/channels.hpp index f98cafb..4854c98 100644 --- a/components/channels.hpp +++ b/components/channels.hpp @@ -131,6 +131,7 @@ protected: bool IsTextChannel(ChannelType type); + void OnRowCollapsed(const Gtk::TreeModel::iterator &iter, const Gtk::TreeModel::Path &path); void OnRowExpanded(const Gtk::TreeModel::iterator &iter, const Gtk::TreeModel::Path &path); public: