diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2023-02-07 15:03:03 -0500 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2023-02-07 15:03:03 -0500 |
commit | c1303bd289013a504b529f8f19444f12e4884040 (patch) | |
tree | 9318ba0b3b660264cba5c4a467b6f79cf80188e0 /src/components/channelscellrenderer.hpp | |
parent | ea04035f0db8fa990dd7ca8dd1a64f56bceb82e2 (diff) | |
parent | 4dd0eb24c40a7276dea4fc349d885f4277795dcb (diff) | |
download | abaddon-portaudio-c1303bd289013a504b529f8f19444f12e4884040.tar.gz abaddon-portaudio-c1303bd289013a504b529f8f19444f12e4884040.zip |
Merge branch 'master' into voice
Diffstat (limited to 'src/components/channelscellrenderer.hpp')
-rw-r--r-- | src/components/channelscellrenderer.hpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/components/channelscellrenderer.hpp b/src/components/channelscellrenderer.hpp index e8ba5f5..f6859dc 100644 --- a/src/components/channelscellrenderer.hpp +++ b/src/components/channelscellrenderer.hpp @@ -1,11 +1,11 @@ #pragma once -#include <gtkmm/cellrenderertext.h> #include <gdkmm/pixbufanimation.h> #include <glibmm/property.h> #include <map> #include "discord/snowflake.hpp" enum class RenderType : uint8_t { + Folder, Guild, Category, TextChannel, @@ -33,6 +33,7 @@ public: Glib::PropertyProxy<Glib::RefPtr<Gdk::PixbufAnimation>> property_icon_animation(); Glib::PropertyProxy<bool> property_expanded(); Glib::PropertyProxy<bool> property_nsfw(); + Glib::PropertyProxy<std::optional<Gdk::RGBA>> property_color(); protected: void get_preferred_width_vfunc(Gtk::Widget &widget, int &minimum_width, int &natural_width) const override; @@ -46,6 +47,17 @@ protected: Gtk::CellRendererState flags) override; // guild functions + void get_preferred_width_vfunc_folder(Gtk::Widget &widget, int &minimum_width, int &natural_width) const; + void get_preferred_width_for_height_vfunc_folder(Gtk::Widget &widget, int height, int &minimum_width, int &natural_width) const; + void get_preferred_height_vfunc_folder(Gtk::Widget &widget, int &minimum_height, int &natural_height) const; + void get_preferred_height_for_width_vfunc_folder(Gtk::Widget &widget, int width, int &minimum_height, int &natural_height) const; + void render_vfunc_folder(const Cairo::RefPtr<Cairo::Context> &cr, + Gtk::Widget &widget, + const Gdk::Rectangle &background_area, + const Gdk::Rectangle &cell_area, + Gtk::CellRendererState flags); + + // guild functions void get_preferred_width_vfunc_guild(Gtk::Widget &widget, int &minimum_width, int &natural_width) const; void get_preferred_width_for_height_vfunc_guild(Gtk::Widget &widget, int height, int &minimum_width, int &natural_width) const; void get_preferred_height_vfunc_guild(Gtk::Widget &widget, int &minimum_height, int &natural_height) const; @@ -148,6 +160,7 @@ private: Glib::Property<Glib::RefPtr<Gdk::PixbufAnimation>> m_property_pixbuf_animation; // guild Glib::Property<bool> m_property_expanded; // category Glib::Property<bool> m_property_nsfw; // channel + Glib::Property<std::optional<Gdk::RGBA>> m_property_color; // folder // same pitfalls as in https://github.com/uowuo/abaddon/blob/60404783bd4ce9be26233fe66fc3a74475d9eaa3/components/cellrendererpixbufanimation.hpp#L32-L39 // this will manifest though since guild icons can change |