diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-07-05 17:35:53 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-07-05 17:35:53 -0400 |
commit | 9ec52e3473f4e90ba940324a5d058afefc0bd8f1 (patch) | |
tree | c03cd181600b50e8e0ecebff727128cbff0fb52c /components | |
parent | 3565ec885ef631fbfe86c5b2da287ecce0ddf23b (diff) | |
download | abaddon-portaudio-9ec52e3473f4e90ba940324a5d058afefc0bd8f1.tar.gz abaddon-portaudio-9ec52e3473f4e90ba940324a5d058afefc0bd8f1.zip |
make ChannelList directly subclass a container
Diffstat (limited to 'components')
-rw-r--r-- | components/channels.cpp | 12 | ||||
-rw-r--r-- | components/channels.hpp | 4 |
2 files changed, 5 insertions, 11 deletions
diff --git a/components/channels.cpp b/components/channels.cpp index bde5639..520c8fd 100644 --- a/components/channels.cpp +++ b/components/channels.cpp @@ -8,8 +8,9 @@ #include "statusindicator.hpp" ChannelList::ChannelList() - : m_model(Gtk::TreeStore::create(m_columns)) - , m_main(Gtk::manage(new Gtk::ScrolledWindow)) { + : Glib::ObjectBase(typeid(ChannelList)) + , Gtk::ScrolledWindow() + , m_model(Gtk::TreeStore::create(m_columns)) { const auto cb = [this](const Gtk::TreeModel::Path &path, Gtk::TreeViewColumn *column) { auto row = *m_model->get_iter(path); if (row[m_columns.m_expanded]) { @@ -38,8 +39,7 @@ ChannelList::ChannelList() m_view.show(); - m_main->add(m_view); - m_main->show_all(); + add(m_view); auto *column = Gtk::manage(new Gtk::TreeView::Column("display")); auto *renderer = Gtk::manage(new CellRendererChannels); @@ -51,10 +51,6 @@ ChannelList::ChannelList() m_view.append_column(*column); } -Gtk::Widget *ChannelList::GetRoot() const { - return m_main; -} - void ChannelList::UpdateListing() { m_model->clear(); diff --git a/components/channels.hpp b/components/channels.hpp index 4854c98..0bc0b04 100644 --- a/components/channels.hpp +++ b/components/channels.hpp @@ -81,10 +81,9 @@ private: Glib::Property<bool> m_property_expanded; // category }; -class ChannelList { +class ChannelList : public Gtk::ScrolledWindow { public: ChannelList(); - Gtk::Widget *GetRoot() const; void UpdateListing(); void UpdateNewGuild(Snowflake id); void UpdateRemoveGuild(Snowflake id); @@ -97,7 +96,6 @@ public: void SetActiveChannel(Snowflake id); protected: - Gtk::ScrolledWindow *m_main; Gtk::TreeView m_view; class ModelColumns : public Gtk::TreeModel::ColumnRecord { |