summaryrefslogtreecommitdiff
path: root/components/statusindicator.hpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2021-01-26 02:40:50 -0500
committerouwou <26526779+ouwou@users.noreply.github.com>2021-01-26 02:40:50 -0500
commitdabfefafd9c681231f990eccddc771ccf5c2c2e2 (patch)
tree35fc440dbacf8367fa650dde89217b23cf08bf33 /components/statusindicator.hpp
parente6c159659d30ca3cc955b9a7f7969f51d87a0bf9 (diff)
downloadabaddon-portaudio-dabfefafd9c681231f990eccddc771ccf5c2c2e2.tar.gz
abaddon-portaudio-dabfefafd9c681231f990eccddc771ccf5c2c2e2.zip
show status indicators in member list, change some other shit with presences
Diffstat (limited to 'components/statusindicator.hpp')
-rw-r--r--components/statusindicator.hpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/components/statusindicator.hpp b/components/statusindicator.hpp
new file mode 100644
index 0000000..9c7382e
--- /dev/null
+++ b/components/statusindicator.hpp
@@ -0,0 +1,30 @@
+#pragma once
+#include <gtkmm.h>
+#include "../discord/snowflake.hpp"
+
+class StatusIndicator : public Gtk::Widget {
+public:
+ StatusIndicator(Snowflake user_id);
+ virtual ~StatusIndicator();
+
+protected:
+ Gtk::SizeRequestMode get_request_mode_vfunc() const override;
+ void get_preferred_width_vfunc(int &minimum_width, int &natural_width) const override;
+ void get_preferred_height_for_width_vfunc(int width, int &minimum_height, int &natural_height) const override;
+ void get_preferred_height_vfunc(int &minimum_height, int &natural_height) const override;
+ void get_preferred_width_for_height_vfunc(int height, int &minimum_width, int &natural_width) const override;
+ void on_size_allocate(Gtk::Allocation &allocation) override;
+ void on_map() override;
+ void on_unmap() override;
+ void on_realize() override;
+ void on_unrealize() override;
+ bool on_draw(const Cairo::RefPtr<Cairo::Context> &cr) override;
+
+ Glib::RefPtr<Gdk::Window> m_window;
+
+private:
+ void CheckStatus();
+
+ Snowflake m_id;
+ Gdk::RGBA m_color;
+};