diff options
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 { |