diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-05-24 02:03:42 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-05-24 02:03:42 -0400 |
commit | c75a91d15fcabae16b06b2e3de3ba585adff68b6 (patch) | |
tree | ea7b6a71e8c117d661d30fbf4f9317dd27f20753 /components | |
parent | b2655260fa139af114e96d6dcf1dcc35e80a7efb (diff) | |
download | abaddon-portaudio-c75a91d15fcabae16b06b2e3de3ba585adff68b6.tar.gz abaddon-portaudio-c75a91d15fcabae16b06b2e3de3ba585adff68b6.zip |
add more granular control over emojis
Diffstat (limited to 'components')
-rw-r--r-- | components/channels.cpp | 8 | ||||
-rw-r--r-- | components/chatmessage.cpp | 10 |
2 files changed, 9 insertions, 9 deletions
diff --git a/components/channels.cpp b/components/channels.cpp index 6e0437a..970251f 100644 --- a/components/channels.cpp +++ b/components/channels.cpp @@ -99,7 +99,7 @@ ChannelListRowDMChannel::ChannelListRowDMChannel(const ChannelData *data) { else if (data->Type == ChannelType::GROUP_DM) buf->set_text(std::to_string(recipients.size()) + " users"); - static bool show_emojis = Abaddon::Get().GetSettings().GetShowEmojis(); + static bool show_emojis = Abaddon::Get().GetSettings().GetShowStockEmojis(); if (show_emojis) Abaddon::Get().GetEmojis().ReplaceEmojis(buf, ChannelEmojiSize); @@ -172,7 +172,7 @@ ChannelListRowGuild::ChannelListRowGuild(const GuildData *data) { Gtk::TextBuffer::iterator start, end; buf->get_bounds(start, end); buf->insert_markup(start, "<b>" + Glib::Markup::escape_text(data->Name) + "</b>"); - static bool show_emojis = Abaddon::Get().GetSettings().GetShowEmojis(); + static bool show_emojis = Abaddon::Get().GetSettings().GetShowStockEmojis(); if (show_emojis) Abaddon::Get().GetEmojis().ReplaceEmojis(buf, ChannelEmojiSize); m_box->set_halign(Gtk::ALIGN_START); @@ -220,7 +220,7 @@ ChannelListRowCategory::ChannelListRowCategory(const ChannelData *data) { auto buf = m_lbl->get_buffer(); buf->set_text(*data->Name); - static bool show_emojis = Abaddon::Get().GetSettings().GetShowEmojis(); + static bool show_emojis = Abaddon::Get().GetSettings().GetShowStockEmojis(); if (show_emojis) Abaddon::Get().GetEmojis().ReplaceEmojis(buf, ChannelEmojiSize); m_box->set_halign(Gtk::ALIGN_START); @@ -275,7 +275,7 @@ ChannelListRowChannel::ChannelListRowChannel(const ChannelData *data) { lbl->get_style_context()->add_class("nsfw"); } buf->set_text("#" + *data->Name); - static bool show_emojis = Abaddon::Get().GetSettings().GetShowEmojis(); + static bool show_emojis = Abaddon::Get().GetSettings().GetShowStockEmojis(); if (show_emojis) Abaddon::Get().GetEmojis().ReplaceEmojis(buf, ChannelEmojiSize); ev->add(*lbl); diff --git a/components/chatmessage.cpp b/components/chatmessage.cpp index 04e621f..28e44fc 100644 --- a/components/chatmessage.cpp +++ b/components/chatmessage.cpp @@ -810,11 +810,11 @@ void ChatMessageItemContainer::HandleCustomEmojis(Gtk::TextView &tv) { } void ChatMessageItemContainer::HandleEmojis(Gtk::TextView &tv) { - static bool emojis = Abaddon::Get().GetSettings().GetShowEmojis(); - if (emojis) { - HandleStockEmojis(tv); - HandleCustomEmojis(tv); - } + static const bool stock_emojis = Abaddon::Get().GetSettings().GetShowStockEmojis(); + static const bool custom_emojis = Abaddon::Get().GetSettings().GetShowCustomEmojis(); + + if (stock_emojis) HandleStockEmojis(tv); + if (custom_emojis) HandleCustomEmojis(tv); } void ChatMessageItemContainer::CleanupEmojis(Glib::RefPtr<Gtk::TextBuffer> buf) { |