From 08d604f8369327cbf2db6f81b733ed2b3f524d2e Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Mon, 5 Apr 2021 02:18:30 -0400 Subject: 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 --- components/completer.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'components/completer.hpp') 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 #include +#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 &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 { -- cgit v1.2.3