2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Some icons moved from sprite to separate files.

This commit is contained in:
John Preston
2016-10-22 21:58:25 +03:00
parent e1478359e6
commit c1d862d8de
47 changed files with 123 additions and 120 deletions

View File

@@ -103,7 +103,7 @@ MediaView::MediaView() : TWidget(App::wnd())
}
});
_transparentBrush = QBrush(App::sprite().copy(st::mvTransparentBrush.rect()));
generateTransparentBrush();
setWindowFlags(Qt::FramelessWindowHint | Qt::BypassWindowManagerHint | Qt::Tool | Qt::NoDropShadowWindowHint);
moveToScreen();
@@ -2628,6 +2628,19 @@ void MediaView::loadBack() {
}
}
void MediaView::generateTransparentBrush() {
auto size = st::mediaviewTransparentSize * cIntRetinaFactor();
auto transparent = QImage(2 * size, 2 * size, QImage::Format_ARGB32_Premultiplied);
transparent.fill(st::mediaviewTransparentBg->c);
{
Painter p(&transparent);
p.fillRect(rtlrect(0, size, size, size, 2 * size), st::mediaviewTransparentFg);
p.fillRect(rtlrect(size, 0, size, size, 2 * size), st::mediaviewTransparentFg);
}
transparent.setDevicePixelRatio(cRetinaFactor());
_transparentBrush = QBrush(transparent);
}
MediaView::LastChatPhoto MediaView::computeLastOverviewChatPhoto() {
LastChatPhoto emptyResult = { nullptr, nullptr };
auto lastPhotoInOverview = [&emptyResult](auto history, auto list) -> LastChatPhoto {