2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Implement some power saving options.

This commit is contained in:
John Preston
2023-02-21 16:31:55 +04:00
parent 02bc950b57
commit 2a4c39b9d7
53 changed files with 446 additions and 108 deletions

View File

@@ -48,6 +48,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/text/text_utilities.h"
#include "ui/cached_round_corners.h"
#include "ui/painter.h"
#include "ui/power_saving.h"
#include "ui/ui_utility.h"
namespace Overview {
@@ -363,11 +364,12 @@ void Photo::paint(Painter &p, const QRect &clip, TextSelection selection, const
}
if (_spoiler) {
const auto paused = context->paused || On(PowerSaving::kChatSpoiler);
Ui::FillSpoilerRect(
p,
QRect(0, 0, _width, _height),
Ui::DefaultImageSpoiler().frame(
_spoiler->index(context->ms, context->paused)));
_spoiler->index(context->ms, paused)));
}
if (selected) {
@@ -517,11 +519,12 @@ void Video::paint(Painter &p, const QRect &clip, TextSelection selection, const
}
if (_spoiler) {
const auto paused = context->paused || On(PowerSaving::kChatSpoiler);
Ui::FillSpoilerRect(
p,
QRect(0, 0, _width, _height),
Ui::DefaultImageSpoiler().frame(
_spoiler->index(context->ms, context->paused)));
_spoiler->index(context->ms, paused)));
}
if (selected) {