mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-09-06 20:13:12 +02:00
Option to remove delay on tooltip
This commit is contained in:
parent
3be793032f
commit
a8161b6a7c
6 changed files with 27 additions and 2 deletions
|
@ -6644,6 +6644,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";
|
||||||
|
|
|
@ -230,6 +230,7 @@ AyuGramSettings::AyuGramSettings() {
|
||||||
increaseWebviewWidth = false;
|
increaseWebviewWidth = false;
|
||||||
|
|
||||||
disableNotificationsDelay = false;
|
disableNotificationsDelay = false;
|
||||||
|
disableTooltipDelay = false;
|
||||||
localPremium = false;
|
localPremium = false;
|
||||||
|
|
||||||
// ~ Customization
|
// ~ Customization
|
||||||
|
@ -413,6 +414,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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,7 @@ public:
|
||||||
bool increaseWebviewWidth;
|
bool increaseWebviewWidth;
|
||||||
|
|
||||||
bool disableNotificationsDelay;
|
bool disableNotificationsDelay;
|
||||||
|
bool disableTooltipDelay;
|
||||||
bool localPremium;
|
bool localPremium;
|
||||||
|
|
||||||
QString appIcon;
|
QString appIcon;
|
||||||
|
@ -130,6 +131,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_appIcon(QString val);
|
void set_appIcon(QString val);
|
||||||
|
@ -203,6 +205,7 @@ NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT(
|
||||||
increaseWebviewHeight,
|
increaseWebviewHeight,
|
||||||
increaseWebviewWidth,
|
increaseWebviewWidth,
|
||||||
disableNotificationsDelay,
|
disableNotificationsDelay,
|
||||||
|
disableTooltipDelay,
|
||||||
localPremium,
|
localPremium,
|
||||||
appIcon,
|
appIcon,
|
||||||
simpleQuotesAndReplies,
|
simpleQuotesAndReplies,
|
||||||
|
|
|
@ -809,6 +809,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(),
|
||||||
|
|
|
@ -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"
|
||||||
|
@ -4208,7 +4209,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;
|
||||||
|
|
|
@ -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"
|
||||||
|
@ -3829,7 +3830,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) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue