diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index ac5ef1dec2..dbb1a60d9a 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -6887,6 +6887,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "ayu_DisableStories" = "Disable Stories"; "ayu_DisableCustomBackgrounds" = "Disable Custom Backgrounds"; "ayu_DisableNotificationsDelay" = "Disable Notify Delay"; +"ayu_DisableTooltipDelay" = "Disable Tooltip Delay"; "ayu_LocalPremium" = "Local Telegram Premium"; "ayu_DisplayGhostStatus" = "Display Ghost Mode Status"; "ayu_CopyUsernameAsLink" = "Copy Username as Link"; diff --git a/Telegram/SourceFiles/ayu/ayu_settings.cpp b/Telegram/SourceFiles/ayu/ayu_settings.cpp index 3d55d637a8..8e8114ed69 100644 --- a/Telegram/SourceFiles/ayu/ayu_settings.cpp +++ b/Telegram/SourceFiles/ayu/ayu_settings.cpp @@ -230,6 +230,7 @@ AyuGramSettings::AyuGramSettings() { increaseWebviewWidth = false; disableNotificationsDelay = false; + disableTooltipDelay = false; localPremium = false; showChannelReactions = true; showGroupReactions = true; @@ -415,6 +416,10 @@ void set_disableNotificationsDelay(bool val) { settings->disableNotificationsDelay = val; } +void set_disableTooltipDelay(bool val) { + settings->disableTooltipDelay = val; +} + void set_localPremium(bool val) { settings->localPremium = val; } diff --git a/Telegram/SourceFiles/ayu/ayu_settings.h b/Telegram/SourceFiles/ayu/ayu_settings.h index 86f2d8c205..1e3065a5f8 100644 --- a/Telegram/SourceFiles/ayu/ayu_settings.h +++ b/Telegram/SourceFiles/ayu/ayu_settings.h @@ -75,6 +75,7 @@ public: bool increaseWebviewWidth; bool disableNotificationsDelay; + bool disableTooltipDelay; bool localPremium; bool showChannelReactions; bool showGroupReactions; @@ -159,6 +160,7 @@ void set_increaseWebviewHeight(bool val); void set_increaseWebviewWidth(bool val); void set_disableNotificationsDelay(bool val); +void set_disableTooltipDelay(bool val); void set_localPremium(bool val); void set_hideChannelReactions(bool val); void set_hideGroupReactions(bool val); @@ -233,6 +235,7 @@ inline void to_json(nlohmann::json &nlohmann_json_j, const AyuGramSettings &nloh NLOHMANN_JSON_TO(increaseWebviewHeight) NLOHMANN_JSON_TO(increaseWebviewWidth) NLOHMANN_JSON_TO(disableNotificationsDelay) + NLOHMANN_JSON_TO(disableTooltipDelay) NLOHMANN_JSON_TO(localPremium) NLOHMANN_JSON_TO(appIcon) NLOHMANN_JSON_TO(simpleQuotesAndReplies) @@ -298,6 +301,7 @@ inline void from_json(const nlohmann::json &nlohmann_json_j, AyuGramSettings &nl NLOHMANN_JSON_FROM_WITH_DEFAULT(increaseWebviewHeight) NLOHMANN_JSON_FROM_WITH_DEFAULT(increaseWebviewWidth) NLOHMANN_JSON_FROM_WITH_DEFAULT(disableNotificationsDelay) + NLOHMANN_JSON_FROM_WITH_DEFAULT(disableTooltipDelay) NLOHMANN_JSON_FROM_WITH_DEFAULT(localPremium) NLOHMANN_JSON_FROM_WITH_DEFAULT(appIcon) NLOHMANN_JSON_FROM_WITH_DEFAULT(simpleQuotesAndReplies) diff --git a/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp b/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp index e6c05e1ffb..af742d7d84 100644 --- a/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp +++ b/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp @@ -808,6 +808,18 @@ void SetupQoLToggles(not_null container) { }, container->lifetime()); + AddButtonWithIcon(container, tr::ayu_DisableTooltipDelay(), st::settingsButtonNoIcon) + ->toggleOn(rpl::single(settings->disableTooltipDelay)) + ->toggledValue() | + rpl::filter([=](bool enabled) { return (enabled != settings->disableTooltipDelay); }) | + start_with_next( + [=](bool enabled) + { + AyuSettings::set_disableTooltipDelay(enabled); + AyuSettings::save(); + }, + container->lifetime()); + AddButtonWithIcon( container, tr::ayu_ShowOnlyAddedEmojisAndStickers(), diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp index 18d9c373fe..abc2e4c7eb 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.cpp +++ b/Telegram/SourceFiles/history/history_inner_widget.cpp @@ -22,6 +22,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "history/view/reactions/history_view_reactions_selector.h" #include "history/view/history_view_about_view.h" #include "history/view/history_view_message.h" +#include "ayu/ayu_settings.h" #include "history/view/history_view_service_message.h" #include "history/view/history_view_cursor_state.h" #include "history/view/history_view_context_menu.h" @@ -4359,7 +4360,8 @@ void HistoryInner::mouseActionUpdate() { || dragState.cursor == CursorState::Date || dragState.cursor == CursorState::Forwarded || dragState.customTooltip) { - Ui::Tooltip::Show(350, this); + const auto delay = AyuSettings::getInstance().disableTooltipDelay ? 0 : crl::time(350); + Ui::Tooltip::Show(delay, this); } Qt::CursorShape cur = style::cur_default; diff --git a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp index 0217ef24e3..411f85af11 100644 --- a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp +++ b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp @@ -21,6 +21,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "history/view/reactions/history_view_reactions_selector.h" #include "history/view/history_view_context_menu.h" #include "history/view/history_view_element.h" +#include "ayu/ayu_settings.h" #include "history/view/history_view_emoji_interactions.h" #include "history/view/history_view_message.h" #include "history/view/history_view_service_message.h" @@ -3836,7 +3837,8 @@ void ListWidget::mouseActionUpdate() { if (dragState.link || dragState.cursor == CursorState::Date || dragState.cursor == CursorState::Forwarded) { - Ui::Tooltip::Show(350, this); + const auto delay = AyuSettings::getInstance().disableTooltipDelay ? 0 : crl::time(350); + Ui::Tooltip::Show(delay, this); } if (_mouseAction == MouseAction::None) {