2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

dialogs optimizations, qt 5.5.0 xcode 7 build

This commit is contained in:
John Preston
2015-09-29 16:24:39 +03:00
parent d8b421993d
commit 94fe669c6e
16 changed files with 571 additions and 864 deletions

View File

@@ -149,10 +149,11 @@ void stopGif() {
animated.stop();
}
void DialogRow::paint(Painter &p, int32 w, bool act, bool sel) const {
void DialogRow::paint(Painter &p, int32 w, bool act, bool sel, bool onlyBackground) const {
QRect fullRect(0, 0, w, st::dlgHeight);
p.fillRect(fullRect, (act ? st::dlgActiveBG : (sel ? st::dlgHoverBG : st::dlgBG))->b);
if (onlyBackground) return;
p.drawPixmap(st::dlgPaddingHor, st::dlgPaddingVer, history->peer->photo->pix(st::dlgPhotoSize));
int32 nameleft = st::dlgPaddingHor + st::dlgPhotoSize + st::dlgPhotoPadding;
@@ -240,10 +241,11 @@ void DialogRow::paint(Painter &p, int32 w, bool act, bool sel) const {
history->peer->dialogName().drawElided(p, rectForName.left(), rectForName.top(), rectForName.width());
}
void FakeDialogRow::paint(Painter &p, int32 w, bool act, bool sel) const {
void FakeDialogRow::paint(Painter &p, int32 w, bool act, bool sel, bool onlyBackground) const {
QRect fullRect(0, 0, w, st::dlgHeight);
p.fillRect(fullRect, (act ? st::dlgActiveBG : (sel ? st::dlgHoverBG : st::dlgBG))->b);
if (onlyBackground) return;
History *history = _item->history();
p.drawPixmap(st::dlgPaddingHor, st::dlgPaddingVer, history->peer->photo->pix(st::dlgPhotoSize));