diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-04-05 02:18:30 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-04-05 02:18:30 -0400 |
commit | 08d604f8369327cbf2db6f81b733ed2b3f524d2e (patch) | |
tree | c6ea3e4746c59b2007daac8dc1e5d7b39e1f35f3 /components/completer.hpp | |
parent | fa0e95f68c21e18b401dd955d4d5560db166300a (diff) | |
download | abaddon-portaudio-08d604f8369327cbf2db6f81b733ed2b3f524d2e.tar.gz abaddon-portaudio-08d604f8369327cbf2db6f81b733ed2b3f524d2e.zip |
allow using animated emojis + emojis from other servers w/ nitro
also hide unavailable emojis and role-locked emojis. if you have the role it still wont show up yet though
Diffstat (limited to 'components/completer.hpp')
-rw-r--r-- | components/completer.hpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/components/completer.hpp b/components/completer.hpp index 259fcdc..a669824 100644 --- a/components/completer.hpp +++ b/components/completer.hpp @@ -1,24 +1,31 @@ #pragma once #include <gtkmm.h> #include <functional> +#include "lazyimage.hpp" #include "../discord/snowflake.hpp" +constexpr static int CompleterImageSize = 24; + class CompleterEntry : public Gtk::ListBoxRow { public: CompleterEntry(const Glib::ustring &completion, int index); void SetTextColor(int color); // SetText will reset void SetText(const Glib::ustring &text); void SetImage(const Glib::RefPtr<Gdk::Pixbuf> &pb); + void SetImage(const std::string &url); + void SetAnimation(const std::string &url); int GetIndex() const; Glib::ustring GetCompletion() const; private: + void CheckImage(); + Glib::ustring m_completion; int m_index; Gtk::Box m_box; Gtk::Label *m_text = nullptr; - Gtk::Image *m_img = nullptr; + LazyImage *m_img = nullptr; }; class Completer : public Gtk::Revealer { |