[Option][GUI] Big emoji outline

This commit is contained in:
Eric Kotato 2022-08-26 15:39:43 +03:00 committed by Eric Kotato
parent 99a6a8fad4
commit 3d906ce507
6 changed files with 27 additions and 1 deletions

View file

@ -28,6 +28,7 @@
"ktg_mac_menu_show": "Show Kotatogram", "ktg_mac_menu_show": "Show Kotatogram",
"ktg_settings_kotato": "Kotatogram Settings", "ktg_settings_kotato": "Kotatogram Settings",
"ktg_settings_chats": "Chats", "ktg_settings_chats": "Chats",
"ktg_settings_emoji_outline": "Big emoji outline",
"ktg_fonts_title": "Fonts", "ktg_fonts_title": "Fonts",
"ktg_settings_fonts": "Change application fonts", "ktg_settings_fonts": "Change application fonts",
"ktg_fonts_reset": "Reset", "ktg_fonts_reset": "Reset",

View file

@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/ */
#include "chat_helpers/stickers_emoji_image_loader.h" #include "chat_helpers/stickers_emoji_image_loader.h"
#include "kotato/kotato_settings.h"
#include "styles/style_chat.h" #include "styles/style_chat.h"
#include <QtCore/QtMath> #include <QtCore/QtMath>
@ -35,7 +36,9 @@ QImage EmojiImageLoader::prepare(EmojiPtr emoji) const {
auto tinted = QImage( auto tinted = QImage(
QSize(st::largeEmojiSize, st::largeEmojiSize) * factor, QSize(st::largeEmojiSize, st::largeEmojiSize) * factor,
QImage::Format_ARGB32_Premultiplied); QImage::Format_ARGB32_Premultiplied);
tinted.fill(Qt::white); tinted.fill(::Kotato::JsonSettings::GetBool("big_emoji_outline")
? Qt::white
: QColor(0, 0, 0, 0));
if (loaded) { if (loaded) {
QPainter p(&tinted); QPainter p(&tinted);
p.setCompositionMode(QPainter::CompositionMode_DestinationIn); p.setCompositionMode(QPainter::CompositionMode_DestinationIn);

View file

@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/ */
#include "chat_helpers/stickers_emoji_pack.h" #include "chat_helpers/stickers_emoji_pack.h"
#include "kotato/kotato_settings.h"
#include "chat_helpers/stickers_emoji_image_loader.h" #include "chat_helpers/stickers_emoji_image_loader.h"
#include "history/view/history_view_element.h" #include "history/view/history_view_element.h"
#include "history/history_item.h" #include "history/history_item.h"
@ -112,6 +113,13 @@ EmojiPack::EmojiPack(not_null<Main::Session*> session)
refreshAll(); refreshAll();
}, _lifetime); }, _lifetime);
::Kotato::JsonSettings::Events(
"big_emoji_outline"
) | rpl::start_with_next([=] {
_images.clear();
refreshAll();
}, _lifetime);
Ui::Emoji::Updated( Ui::Emoji::Updated(
) | rpl::start_with_next([=] { ) | rpl::start_with_next([=] {
_images.clear(); _images.clear();

View file

@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/ */
#include "history/history_widget.h" #include "history/history_widget.h"
#include "kotato/kotato_settings.h"
#include "api/api_editing.h" #include "api/api_editing.h"
#include "api/api_bot.h" #include "api/api_bot.h"
#include "api/api_chat_participants.h" #include "api/api_chat_participants.h"
@ -634,6 +635,14 @@ HistoryWidget::HistoryWidget(
}); });
}, lifetime()); }, lifetime());
::Kotato::JsonSettings::Events(
"big_emoji_outline"
) | rpl::start_with_next([=] {
crl::on_main(this, [=] {
updateHistoryGeometry();
});
}, lifetime());
session().data().channelDifferenceTooLong( session().data().channelDifferenceTooLong(
) | rpl::filter([=](not_null<ChannelData*> channel) { ) | rpl::filter([=](not_null<ChannelData*> channel) {
return _peer == channel.get(); return _peer == channel.get();

View file

@ -226,6 +226,9 @@ const std::map<QString, Definition, std::greater<QString>> DefinitionMap {
{ "fonts/size", { { "fonts/size", {
.type = SettingType::IntSetting, .type = SettingType::IntSetting,
.defaultValue = 0, }}, .defaultValue = 0, }},
{ "big_emoji_outline", {
.type = SettingType::BoolSetting,
.defaultValue = true, }},
}; };
using OldOptionKey = QString; using OldOptionKey = QString;

View file

@ -88,6 +88,8 @@ void SetupKotatoChats(
void SetupKotatoMessages(not_null<Ui::VerticalLayout*> container) { void SetupKotatoMessages(not_null<Ui::VerticalLayout*> container) {
Ui::AddSubsectionTitle(container, rktr("ktg_settings_messages")); Ui::AddSubsectionTitle(container, rktr("ktg_settings_messages"));
SettingsMenuJsonSwitch(ktg_settings_emoji_outline, big_emoji_outline);
Ui::AddSkip(container); Ui::AddSkip(container);
} }