diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index f1672f196..6e4bd6f68 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -2518,5 +2518,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "ktg_settings_chat_id_bot" = "Bot API"; "ktg_message_id" = "Message ID: {id}"; +"ktg_emoji_panel_hover" = "Emoji panel on hover"; // Keys finished diff --git a/Telegram/Resources/langs/rewrites/ru.json b/Telegram/Resources/langs/rewrites/ru.json index 7235cd573..378e97582 100644 --- a/Telegram/Resources/langs/rewrites/ru.json +++ b/Telegram/Resources/langs/rewrites/ru.json @@ -121,5 +121,6 @@ "ktg_settings_chat_id_disable": "Скрыть", "ktg_settings_chat_id_telegram": "Telegram API", "ktg_settings_chat_id_bot": "Bot API", - "ktg_message_id": "ID сообщения: {id}" + "ktg_message_id": "ID сообщения: {id}", + "ktg_emoji_panel_hover": "Панель эмодзи по наведению" } diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 65271da19..771c2f9d6 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -543,6 +543,13 @@ HistoryWidget::HistoryWidget( }); }, lifetime()); + HoverEmojiPanelChanges( + ) | rpl::start_with_next([=] { + crl::on_main(this, [=] { + refreshTabbedPanel(); + }); + }, lifetime()); + session().data().animationPlayInlineRequest( ) | rpl::start_with_next([=](not_null item) { if (const auto view = item->mainView()) { @@ -4180,7 +4187,9 @@ void HistoryWidget::createTabbedPanel() { void HistoryWidget::setTabbedPanel(std::unique_ptr panel) { _tabbedPanel = std::move(panel); if (const auto raw = _tabbedPanel.get()) { - _tabbedSelectorToggle->installEventFilter(raw); + if (HoverEmojiPanel()) { + _tabbedSelectorToggle->installEventFilter(raw); + } _tabbedSelectorToggle->setColorOverrides(nullptr, nullptr, nullptr); } else { _tabbedSelectorToggle->setColorOverrides( diff --git a/Telegram/SourceFiles/kotato/json_settings.cpp b/Telegram/SourceFiles/kotato/json_settings.cpp index aa04e2ec2..b559915cd 100644 --- a/Telegram/SourceFiles/kotato/json_settings.cpp +++ b/Telegram/SourceFiles/kotato/json_settings.cpp @@ -190,6 +190,7 @@ QByteArray GenerateSettingsJson(bool areDefault = false) { settings.insert(qsl("always_show_top_userpic"), cShowTopBarUserpic()); settings.insert(qsl("custom_app_icon"), cCustomAppIcon()); settings.insert(qsl("profile_top_mute"), cProfileTopBarNotifications()); + settings.insert(qsl("hover_emoji_panel"), HoverEmojiPanel()); settingsFonts.insert(qsl("use_system_font"), cUseSystemFont()); settingsFonts.insert(qsl("use_original_metrics"), cUseOriginalMetrics()); @@ -446,6 +447,10 @@ bool Manager::readCustomFile() { ReadBoolOption(settings, "profile_top_mute", [&](auto v) { cSetProfileTopBarNotifications(v); }); + + ReadBoolOption(settings, "hover_emoji_panel", [&](auto v) { + SetHoverEmojiPanel(v); + }); return true; } diff --git a/Telegram/SourceFiles/kotato/settings.cpp b/Telegram/SourceFiles/kotato/settings.cpp index ec9e8dc22..e119b0ce4 100644 --- a/Telegram/SourceFiles/kotato/settings.cpp +++ b/Telegram/SourceFiles/kotato/settings.cpp @@ -137,3 +137,14 @@ bool gHideFilterNames = false; bool gHideFilterAllChats = false; bool gProfileTopBarNotifications = false; + +rpl::variable gHoverEmojiPanel = true; +void SetHoverEmojiPanel(bool enabled) { + gHoverEmojiPanel = enabled; +} +bool HoverEmojiPanel() { + return gHoverEmojiPanel.current(); +} +rpl::producer HoverEmojiPanelChanges() { + return gHoverEmojiPanel.changes(); +} diff --git a/Telegram/SourceFiles/kotato/settings.h b/Telegram/SourceFiles/kotato/settings.h index f3cf56cf4..deffe9867 100644 --- a/Telegram/SourceFiles/kotato/settings.h +++ b/Telegram/SourceFiles/kotato/settings.h @@ -103,3 +103,7 @@ DeclareSetting(bool, HideFilterNames); DeclareSetting(bool, HideFilterAllChats); DeclareSetting(bool, ProfileTopBarNotifications); + +void SetHoverEmojiPanel(bool enabled); +[[nodiscard]] bool HoverEmojiPanel(); +[[nodiscard]] rpl::producer HoverEmojiPanelChanges(); diff --git a/Telegram/SourceFiles/kotato/settings_menu.cpp b/Telegram/SourceFiles/kotato/settings_menu.cpp index 8995d0f48..f2a6868f0 100644 --- a/Telegram/SourceFiles/kotato/settings_menu.cpp +++ b/Telegram/SourceFiles/kotato/settings_menu.cpp @@ -223,6 +223,7 @@ void SetupKotatoChats(not_null container) { }, container->lifetime()); SettingsMenuCSwitch(ktg_settings_always_show_scheduled, AlwaysShowScheduled); + SettingsMenuSwitch(ktg_emoji_panel_hover, HoverEmojiPanel); AddButton( container,