This commit is contained in:
Neurotoxin001 2025-07-29 02:28:34 +03:00 committed by GitHub
commit 7e79f6e4b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 28 additions and 2 deletions

View file

@ -6887,6 +6887,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"ayu_DisableStories" = "Disable Stories"; "ayu_DisableStories" = "Disable Stories";
"ayu_DisableCustomBackgrounds" = "Disable Custom Backgrounds"; "ayu_DisableCustomBackgrounds" = "Disable Custom Backgrounds";
"ayu_DisableNotificationsDelay" = "Disable Notify Delay"; "ayu_DisableNotificationsDelay" = "Disable Notify Delay";
"ayu_DisableTooltipDelay" = "Disable Tooltip Delay";
"ayu_LocalPremium" = "Local Telegram Premium"; "ayu_LocalPremium" = "Local Telegram Premium";
"ayu_DisplayGhostStatus" = "Display Ghost Mode Status"; "ayu_DisplayGhostStatus" = "Display Ghost Mode Status";
"ayu_CopyUsernameAsLink" = "Copy Username as Link"; "ayu_CopyUsernameAsLink" = "Copy Username as Link";

View file

@ -230,6 +230,7 @@ AyuGramSettings::AyuGramSettings() {
increaseWebviewWidth = false; increaseWebviewWidth = false;
disableNotificationsDelay = false; disableNotificationsDelay = false;
disableTooltipDelay = false;
localPremium = false; localPremium = false;
showChannelReactions = true; showChannelReactions = true;
showGroupReactions = true; showGroupReactions = true;
@ -415,6 +416,10 @@ void set_disableNotificationsDelay(bool val) {
settings->disableNotificationsDelay = val; settings->disableNotificationsDelay = val;
} }
void set_disableTooltipDelay(bool val) {
settings->disableTooltipDelay = val;
}
void set_localPremium(bool val) { void set_localPremium(bool val) {
settings->localPremium = val; settings->localPremium = val;
} }

View file

@ -75,6 +75,7 @@ public:
bool increaseWebviewWidth; bool increaseWebviewWidth;
bool disableNotificationsDelay; bool disableNotificationsDelay;
bool disableTooltipDelay;
bool localPremium; bool localPremium;
bool showChannelReactions; bool showChannelReactions;
bool showGroupReactions; bool showGroupReactions;
@ -159,6 +160,7 @@ void set_increaseWebviewHeight(bool val);
void set_increaseWebviewWidth(bool val); void set_increaseWebviewWidth(bool val);
void set_disableNotificationsDelay(bool val); void set_disableNotificationsDelay(bool val);
void set_disableTooltipDelay(bool val);
void set_localPremium(bool val); void set_localPremium(bool val);
void set_hideChannelReactions(bool val); void set_hideChannelReactions(bool val);
void set_hideGroupReactions(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(increaseWebviewHeight)
NLOHMANN_JSON_TO(increaseWebviewWidth) NLOHMANN_JSON_TO(increaseWebviewWidth)
NLOHMANN_JSON_TO(disableNotificationsDelay) NLOHMANN_JSON_TO(disableNotificationsDelay)
NLOHMANN_JSON_TO(disableTooltipDelay)
NLOHMANN_JSON_TO(localPremium) NLOHMANN_JSON_TO(localPremium)
NLOHMANN_JSON_TO(appIcon) NLOHMANN_JSON_TO(appIcon)
NLOHMANN_JSON_TO(simpleQuotesAndReplies) 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(increaseWebviewHeight)
NLOHMANN_JSON_FROM_WITH_DEFAULT(increaseWebviewWidth) NLOHMANN_JSON_FROM_WITH_DEFAULT(increaseWebviewWidth)
NLOHMANN_JSON_FROM_WITH_DEFAULT(disableNotificationsDelay) NLOHMANN_JSON_FROM_WITH_DEFAULT(disableNotificationsDelay)
NLOHMANN_JSON_FROM_WITH_DEFAULT(disableTooltipDelay)
NLOHMANN_JSON_FROM_WITH_DEFAULT(localPremium) NLOHMANN_JSON_FROM_WITH_DEFAULT(localPremium)
NLOHMANN_JSON_FROM_WITH_DEFAULT(appIcon) NLOHMANN_JSON_FROM_WITH_DEFAULT(appIcon)
NLOHMANN_JSON_FROM_WITH_DEFAULT(simpleQuotesAndReplies) NLOHMANN_JSON_FROM_WITH_DEFAULT(simpleQuotesAndReplies)

View file

@ -808,6 +808,18 @@ void SetupQoLToggles(not_null<Ui::VerticalLayout*> container) {
}, },
container->lifetime()); 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( AddButtonWithIcon(
container, container,
tr::ayu_ShowOnlyAddedEmojisAndStickers(), tr::ayu_ShowOnlyAddedEmojisAndStickers(),

View file

@ -22,6 +22,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "history/view/reactions/history_view_reactions_selector.h" #include "history/view/reactions/history_view_reactions_selector.h"
#include "history/view/history_view_about_view.h" #include "history/view/history_view_about_view.h"
#include "history/view/history_view_message.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_service_message.h"
#include "history/view/history_view_cursor_state.h" #include "history/view/history_view_cursor_state.h"
#include "history/view/history_view_context_menu.h" #include "history/view/history_view_context_menu.h"
@ -4359,7 +4360,8 @@ void HistoryInner::mouseActionUpdate() {
|| dragState.cursor == CursorState::Date || dragState.cursor == CursorState::Date
|| dragState.cursor == CursorState::Forwarded || dragState.cursor == CursorState::Forwarded
|| dragState.customTooltip) { || 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; Qt::CursorShape cur = style::cur_default;

View file

@ -21,6 +21,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "history/view/reactions/history_view_reactions_selector.h" #include "history/view/reactions/history_view_reactions_selector.h"
#include "history/view/history_view_context_menu.h" #include "history/view/history_view_context_menu.h"
#include "history/view/history_view_element.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_emoji_interactions.h"
#include "history/view/history_view_message.h" #include "history/view/history_view_message.h"
#include "history/view/history_view_service_message.h" #include "history/view/history_view_service_message.h"
@ -3836,7 +3837,8 @@ void ListWidget::mouseActionUpdate() {
if (dragState.link if (dragState.link
|| dragState.cursor == CursorState::Date || dragState.cursor == CursorState::Date
|| dragState.cursor == CursorState::Forwarded) { || 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) { if (_mouseAction == MouseAction::None) {