mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-03 16:15:13 +00:00
Added small round to document thumbnails in overview layout.
This commit is contained in:
@@ -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
|
||||||
|
| (_thumbLoaded
|
||||||
? Images::Option()
|
? Images::Option()
|
||||||
: Images::Option::Blur;
|
: 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())) {
|
||||||
|
Reference in New Issue
Block a user