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
This commit is contained in:
ouwou
2021-04-05 02:18:30 -04:00
parent fa0e95f68c
commit 08d604f836
5 changed files with 84 additions and 36 deletions

View File

@@ -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 {