Add experimental sticker size option

This commit is contained in:
Ilya Fedin
2026-03-04 08:41:48 +00:00
committed by 23rd
parent 66a5e67cbf
commit 1782f5c463
@@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "history/view/media/history_view_sticker.h"
#include "base/options.h"
#include "boxes/sticker_set_box.h"
#include "history/history.h"
#include "history/history_item_components.h"
@@ -46,6 +47,11 @@ constexpr auto kPremiumMultiplier = (1 + 0.245 * 2);
constexpr auto kEmojiMultiplier = 3;
constexpr auto kMessageEffectMultiplier = 2;
base::options::option<int> OptionStickerSize({
.id = "sticker-size",
.name = "Sticker size",
});
[[nodiscard]] QImage CacheDiceImage(
const QString &emoji,
int index,
@@ -192,7 +198,9 @@ bool Sticker::readyToDrawAnimationFrame() {
}
QSize Sticker::Size() {
const auto side = std::min(st::maxStickerSize, kMaxSizeFixed);
const auto side = OptionStickerSize.value() > 0
? style::ConvertScale(OptionStickerSize.value())
: std::min(st::maxStickerSize, kMaxSizeFixed);
return { side, side };
}