mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Add a power saving option to stop user statuses.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user