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