mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
Add a power saving option to stop user statuses.
This commit is contained in:
parent
3b3ee6fbbe
commit
e6b92eaf37
7 changed files with 9 additions and 4 deletions
|
@ -620,6 +620,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
"lng_settings_power_emoji_panel" = "Autoplay in panel";
|
||||
"lng_settings_power_emoji_reactions" = "Autoplay in reactions menu";
|
||||
"lng_settings_power_emoji_chat" = "Autoplay in messages";
|
||||
"lng_settings_power_emoji_status" = "Autoplay in premium status";
|
||||
"lng_settings_power_chat" = "Animations in Chats";
|
||||
"lng_settings_power_chat_background" = "Background rotation";
|
||||
"lng_settings_power_chat_spoiler" = "Animated spoiler effect";
|
||||
|
|
|
@ -1272,7 +1272,7 @@ void Message::paintFromName(
|
|||
.position = QPoint(
|
||||
x - 2 * _fromNameStatus->skip,
|
||||
y + _fromNameStatus->skip),
|
||||
.paused = context.paused,
|
||||
.paused = context.paused || On(PowerSaving::kEmojiStatus),
|
||||
});
|
||||
} else {
|
||||
st::dialogsPremiumIcon.paint(p, x, y, width(), color);
|
||||
|
|
|
@ -96,7 +96,8 @@ void Badge::setBadge(BadgeType badge, DocumentId emojiStatusId) {
|
|||
auto args = Ui::Text::CustomEmoji::Context{
|
||||
.textColor = _st.premiumFg->c,
|
||||
.now = crl::now(),
|
||||
.paused = _animationPaused && _animationPaused(),
|
||||
.paused = ((_animationPaused && _animationPaused())
|
||||
|| On(PowerSaving::kEmojiStatus)),
|
||||
};
|
||||
if (!_emojiStatusPanel
|
||||
|| !_emojiStatusPanel->paintBadgeFrame(check)) {
|
||||
|
|
|
@ -144,6 +144,7 @@ EditFlagsDescriptor<PowerSaving::Flags> PowerSavingLabels() {
|
|||
},
|
||||
{ kEmojiReactions, tr::lng_settings_power_emoji_reactions(tr::now) },
|
||||
{ kEmojiChat, tr::lng_settings_power_emoji_chat(tr::now) },
|
||||
{ kEmojiStatus, tr::lng_settings_power_emoji_status(tr::now) },
|
||||
};
|
||||
auto chat = std::vector<Label>{
|
||||
{
|
||||
|
|
|
@ -560,7 +560,7 @@ void EmojiStatusTopBar::paint(QPainter &p) {
|
|||
: QColor(0, 0, 0, 0)),
|
||||
false,
|
||||
crl::now(),
|
||||
_paused);
|
||||
_paused || On(PowerSaving::kEmojiStatus));
|
||||
|
||||
p.drawImage(_rect.toRect(), frame.image);
|
||||
if (!_paused) {
|
||||
|
|
|
@ -19,6 +19,7 @@ enum Flag : uint32 {
|
|||
kChatBackground = (1U << 6),
|
||||
kChatSpoiler = (1U << 7),
|
||||
kCalls = (1U << 8),
|
||||
kEmojiStatus = (1U << 9),
|
||||
|
||||
kAll = (1U << 9) - 1,
|
||||
};
|
||||
|
|
|
@ -14,6 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "main/main_session.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "ui/painter.h"
|
||||
#include "ui/power_saving.h"
|
||||
#include "ui/unread_badge_paint.h"
|
||||
#include "styles/style_dialogs.h"
|
||||
|
||||
|
@ -195,7 +196,7 @@ int PeerBadge::drawGetWidth(
|
|||
.position = QPoint(
|
||||
iconx - 2 * _emojiStatus->skip,
|
||||
icony + _emojiStatus->skip),
|
||||
.paused = descriptor.paused,
|
||||
.paused = descriptor.paused || On(PowerSaving::kEmojiStatus),
|
||||
});
|
||||
return iconw - 4 * _emojiStatus->skip;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue