put tooltips on reactions

This commit is contained in:
ouwou
2021-01-17 23:24:44 -05:00
parent 744e42892d
commit 4fd7f9d75e
3 changed files with 16 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ bool EmojiResource::Load() {
if (shortcode_strlen > 0) {
std::fread(shortcode.data(), shortcode_strlen, 1, m_fp);
m_shortcode_index[shortcode] = pattern_hex;
m_pattern_shortcode_index[pattern_hex] = shortcode;
}
std::fread(&len, 4, 1, m_fp);
@@ -120,6 +121,13 @@ void EmojiResource::ReplaceEmojis(Glib::RefPtr<Gtk::TextBuffer> buf, int size) {
}
}
std::string EmojiResource::GetShortCodeForPattern(const Glib::ustring &pattern) {
auto it = m_pattern_shortcode_index.find(pattern);
if (it != m_pattern_shortcode_index.end())
return it->second;
return "";
}
const std::vector<Glib::ustring> &EmojiResource::GetPatterns() const {
return m_patterns;
}