2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-05 00:55:12 +00:00

moved shadows to widgets where they are displayed

This commit is contained in:
John Preston
2015-10-17 10:31:48 +02:00
parent 48756111a9
commit 5c3d030b9a
20 changed files with 193 additions and 166 deletions

View File

@@ -1489,8 +1489,7 @@ MsgId DialogsInner::lastSearchId() const {
return _lastSearchId;
}
DialogsWidget::DialogsWidget(MainWidget *parent) : QWidget(parent)
, _drawShadow(true)
DialogsWidget::DialogsWidget(MainWidget *parent) : TWidget(parent)
, _dragInScroll(false)
, _dragForward(false)
, _dialogsOffset(0)
@@ -2137,7 +2136,7 @@ void DialogsWidget::onCompleteHashtag(QString tag) {
}
void DialogsWidget::resizeEvent(QResizeEvent *e) {
int32 w = width() - st::dlgShadow;
int32 w = width();
_filter.setGeometry(st::dlgPaddingHor, st::dlgFilterPadding, w - 2 * st::dlgPaddingHor, _filter.height());
_newGroup.move(w - _newGroup.width() - st::dlgPaddingHor, _filter.y());
_addContact.move(w - _addContact.width() - st::dlgPaddingHor, _filter.y());
@@ -2198,20 +2197,14 @@ void DialogsWidget::paintEvent(QPaintEvent *e) {
p.drawPixmap(a_coord.current(), 0, _animCache);
return;
}
QRect above(0, 0, width() - (cWideMode() ? st::dlgShadow : 0), _scroll.y());
QRect above(0, 0, width(), _scroll.y());
if (above.intersects(r)) {
p.fillRect(above.intersected(r), st::white->b);
}
QRect below(0, _scroll.y() + qMin(_scroll.height(), _inner.height()), width() - (cWideMode() ? st::dlgShadow : 0), height());
QRect below(0, _scroll.y() + qMin(_scroll.height(), _inner.height()), width(), height());
if (below.intersects(r)) {
p.fillRect(below.intersected(r), st::white->b);
}
if (cWideMode() && _drawShadow) {
QRect sh(width() - st::dlgShadow, 0, st::dlgShadow, height());
if (r.intersects(sh)) {
p.fillRect(sh, st::dlgShadowColor->b);
}
}
}
void DialogsWidget::destroyData() {
@@ -2308,7 +2301,3 @@ void DialogsWidget::onDialogMoved(int movedFrom, int movedTo) {
_scroll.scrollToY(st + st::dlgHeight);
}
}
void DialogsWidget::enableShadow(bool enable) {
_drawShadow = enable;
}