mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 22:54:01 +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 (thumbnail || blurred) {
|
||||||
if (_thumb.isNull() || (thumbnail && !_thumbLoaded)) {
|
if (_thumb.isNull() || (thumbnail && !_thumbLoaded)) {
|
||||||
_thumbLoaded = (thumbnail != nullptr);
|
_thumbLoaded = (thumbnail != nullptr);
|
||||||
const auto options = _thumbLoaded
|
const auto options = Images::Option::RoundSmall
|
||||||
? Images::Option()
|
| (_thumbLoaded
|
||||||
: Images::Option::Blur;
|
? Images::Option()
|
||||||
|
: Images::Option::Blur);
|
||||||
const auto image = thumbnail ? thumbnail : blurred;
|
const auto image = thumbnail ? thumbnail : blurred;
|
||||||
_thumb = image->pixNoCache(
|
_thumb = image->pixNoCache(
|
||||||
_thumbw * style::DevicePixelRatio(),
|
_thumbw * style::DevicePixelRatio(),
|
||||||
|
@ -1147,10 +1148,20 @@ void Document::paint(Painter &p, const QRect &clip, TextSelection selection, con
|
||||||
}
|
}
|
||||||
p.drawPixmap(rthumb.topLeft(), _thumb);
|
p.drawPixmap(rthumb.topLeft(), _thumb);
|
||||||
} else {
|
} else {
|
||||||
p.fillRect(rthumb, st::overviewFileThumbBg);
|
p.setPen(Qt::NoPen);
|
||||||
|
p.setBrush(st::overviewFileThumbBg);
|
||||||
|
p.drawRoundedRect(
|
||||||
|
rthumb,
|
||||||
|
st::roundRadiusSmall,
|
||||||
|
st::roundRadiusSmall);
|
||||||
}
|
}
|
||||||
} else {
|
} 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()) {
|
if (!radial && loaded && !_ext.isEmpty()) {
|
||||||
p.setFont(st::overviewFileExtFont);
|
p.setFont(st::overviewFileExtFont);
|
||||||
p.setPen(st::overviewFileExtFg);
|
p.setPen(st::overviewFileExtFg);
|
||||||
|
@ -1158,7 +1169,12 @@ void Document::paint(Painter &p, const QRect &clip, TextSelection selection, con
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (selected) {
|
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())) {
|
if (radial || (!loaded && !_data->loading())) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue