mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-03 21:54:05 +02:00
Added small round to document thumbnails in overview layout.
This commit is contained in:
parent
0b86caef67
commit
fec7febc8e
1 changed files with 22 additions and 6 deletions
|
@ -1132,9 +1132,10 @@ void Document::paint(Painter &p, const QRect &clip, TextSelection selection, con
|
|||
if (thumbnail || blurred) {
|
||||
if (_thumb.isNull() || (thumbnail && !_thumbLoaded)) {
|
||||
_thumbLoaded = (thumbnail != nullptr);
|
||||
const auto options = _thumbLoaded
|
||||
? Images::Option()
|
||||
: Images::Option::Blur;
|
||||
const auto options = Images::Option::RoundSmall
|
||||
| (_thumbLoaded
|
||||
? Images::Option()
|
||||
: Images::Option::Blur);
|
||||
const auto image = thumbnail ? thumbnail : blurred;
|
||||
_thumb = image->pixNoCache(
|
||||
_thumbw * style::DevicePixelRatio(),
|
||||
|
@ -1147,10 +1148,20 @@ void Document::paint(Painter &p, const QRect &clip, TextSelection selection, con
|
|||
}
|
||||
p.drawPixmap(rthumb.topLeft(), _thumb);
|
||||
} else {
|
||||
p.fillRect(rthumb, st::overviewFileThumbBg);
|
||||
p.setPen(Qt::NoPen);
|
||||
p.setBrush(st::overviewFileThumbBg);
|
||||
p.drawRoundedRect(
|
||||
rthumb,
|
||||
st::roundRadiusSmall,
|
||||
st::roundRadiusSmall);
|
||||
}
|
||||
} else {
|
||||
p.fillRect(rthumb, _generic.color);
|
||||
p.setPen(Qt::NoPen);
|
||||
p.setBrush(_generic.color);
|
||||
p.drawRoundedRect(
|
||||
rthumb,
|
||||
st::roundRadiusSmall,
|
||||
st::roundRadiusSmall);
|
||||
if (!radial && loaded && !_ext.isEmpty()) {
|
||||
p.setFont(st::overviewFileExtFont);
|
||||
p.setPen(st::overviewFileExtFg);
|
||||
|
@ -1158,7 +1169,12 @@ void Document::paint(Painter &p, const QRect &clip, TextSelection selection, con
|
|||
}
|
||||
}
|
||||
if (selected) {
|
||||
p.fillRect(rthumb, st::defaultTextPalette.selectOverlay);
|
||||
p.setPen(Qt::NoPen);
|
||||
p.setBrush(st::defaultTextPalette.selectOverlay);
|
||||
p.drawRoundedRect(
|
||||
rthumb,
|
||||
st::roundRadiusSmall,
|
||||
st::roundRadiusSmall);
|
||||
}
|
||||
|
||||
if (radial || (!loaded && !_data->loading())) {
|
||||
|
|
Loading…
Add table
Reference in a new issue