From a4d0cd9612dfa8b60fed63f1088b59b1762d217a Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Tue, 20 Jul 2021 17:55:03 -0400 Subject: color nsfw channels --- components/channels.hpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'components/channels.hpp') diff --git a/components/channels.hpp b/components/channels.hpp index d3df2d5..2246b3b 100644 --- a/components/channels.hpp +++ b/components/channels.hpp @@ -12,7 +12,7 @@ constexpr static int GuildIconSize = 24; constexpr static int DMIconSize = 20; constexpr static int OrphanChannelSortOffset = -100; // forces orphan channels to the top of the list -enum class RenderType { +enum class RenderType : uint8_t { Guild, Category, TextChannel, @@ -30,6 +30,7 @@ public: Glib::PropertyProxy property_name(); Glib::PropertyProxy> property_icon(); Glib::PropertyProxy property_expanded(); + Glib::PropertyProxy property_nsfw(); protected: void get_preferred_width_vfunc(Gtk::Widget &widget, int &minimum_width, int &natural_width) const override; @@ -100,11 +101,11 @@ protected: private: Gtk::CellRendererText m_renderer_text; - Glib::Property m_property_type; - - Glib::Property m_property_name; // guild - Glib::Property> m_property_pixbuf; // guild + Glib::Property m_property_type; // all + Glib::Property m_property_name; // all + Glib::Property> m_property_pixbuf; // guild, dm Glib::Property m_property_expanded; // category + Glib::Property m_property_nsfw; // channel }; class ChannelList : public Gtk::ScrolledWindow { @@ -115,7 +116,6 @@ public: void UpdateRemoveGuild(Snowflake id); void UpdateRemoveChannel(Snowflake id); void UpdateChannel(Snowflake id); - void UpdateCreateDMChannel(Snowflake id); void UpdateCreateChannel(Snowflake id); void UpdateGuild(Snowflake id); @@ -133,6 +133,7 @@ protected: Gtk::TreeModelColumn m_name; Gtk::TreeModelColumn> m_icon; Gtk::TreeModelColumn m_sort; + Gtk::TreeModelColumn m_nsfw; // Gtk::CellRenderer's property_is_expanded only works how i want it to if it has children // because otherwise it doesnt count as an "expander" (property_is_expander) // so this solution will have to do which i hate but the alternative is adding invisible children -- cgit v1.2.3