mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 22:54:01 +02:00
Fixed icon scale in call panel when recipient has low level of battery.
This commit is contained in:
parent
2be76760de
commit
5adab2739b
1 changed files with 6 additions and 3 deletions
|
@ -715,18 +715,21 @@ void Panel::createRemoteLowBattery() {
|
||||||
}, _remoteLowBattery->lifetime());
|
}, _remoteLowBattery->lifetime());
|
||||||
|
|
||||||
constexpr auto kBatterySize = QSize(29, 13);
|
constexpr auto kBatterySize = QSize(29, 13);
|
||||||
|
const auto scaledBatterySize = QSize(
|
||||||
|
style::ConvertScale(kBatterySize.width()),
|
||||||
|
style::ConvertScale(kBatterySize.height()));
|
||||||
|
|
||||||
const auto icon = [&] {
|
const auto icon = [&] {
|
||||||
auto svg = QSvgRenderer(
|
auto svg = QSvgRenderer(
|
||||||
BatterySvg(kBatterySize, st::videoPlayIconFg->c));
|
BatterySvg(kBatterySize, st::videoPlayIconFg->c));
|
||||||
auto image = QImage(
|
auto image = QImage(
|
||||||
kBatterySize * style::DevicePixelRatio(),
|
scaledBatterySize * style::DevicePixelRatio(),
|
||||||
QImage::Format_ARGB32_Premultiplied);
|
QImage::Format_ARGB32_Premultiplied);
|
||||||
image.setDevicePixelRatio(style::DevicePixelRatio());
|
image.setDevicePixelRatio(style::DevicePixelRatio());
|
||||||
image.fill(Qt::transparent);
|
image.fill(Qt::transparent);
|
||||||
{
|
{
|
||||||
auto p = QPainter(&image);
|
auto p = QPainter(&image);
|
||||||
svg.render(&p, Rect(kBatterySize));
|
svg.render(&p, Rect(scaledBatterySize));
|
||||||
}
|
}
|
||||||
return image;
|
return image;
|
||||||
}();
|
}();
|
||||||
|
@ -745,7 +748,7 @@ void Panel::createRemoteLowBattery() {
|
||||||
|
|
||||||
p.drawImage(
|
p.drawImage(
|
||||||
st::callTooltipMutedIconPosition.x(),
|
st::callTooltipMutedIconPosition.x(),
|
||||||
(r.height() - kBatterySize.height()) / 2,
|
(r.height() - scaledBatterySize.height()) / 2,
|
||||||
icon);
|
icon);
|
||||||
}, _remoteLowBattery->lifetime());
|
}, _remoteLowBattery->lifetime());
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue