2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-05 08:55:59 +00:00

Added ability to move archive in main menu.

- Added Folder::paintUserpic overload for custom color.
 - Reduced size of _cloudButton.
This commit is contained in:
23rd
2019-05-16 11:39:45 +03:00
committed by John Preston
parent 484ecffb66
commit ece315f3c5
10 changed files with 151 additions and 13 deletions

View File

@@ -220,14 +220,30 @@ void Folder::paintUserpic(
int x,
int y,
int size) const {
paintUserpic(
p,
x,
y,
size,
st::historyPeerArchiveUserpicBg,
st::historyPeerUserpicFg);
}
void Folder::paintUserpic(
Painter &p,
int x,
int y,
int size,
const style::color &bg,
const style::color &fg) const {
p.setPen(Qt::NoPen);
p.setBrush(st::historyPeerArchiveUserpicBg);
p.setBrush(bg);
{
PainterHighQualityEnabler hq(p);
p.drawEllipse(x, y, size, size);
}
if (size == st::dialogsPhotoSize) {
st::dialogsArchiveUserpic.paintInCenter(p, { x, y, size, size });
st::dialogsArchiveUserpic.paintInCenter(p, { x, y, size, size }, fg->c);
} else {
p.save();
const auto ratio = size / float64(st::dialogsPhotoSize);
@@ -236,7 +252,8 @@ void Folder::paintUserpic(
const auto skip = st::dialogsPhotoSize;
st::dialogsArchiveUserpic.paintInCenter(
p,
{ -skip, -skip, 2 * skip, 2 * skip });
{ -skip, -skip, 2 * skip, 2 * skip },
fg->c);
p.restore();
}
//const auto small = (size - st::lineWidth) / 2; // #feed