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

Update Telegram button added to DialogsWidget/Intro. Three dot menu.

This commit is contained in:
John Preston
2016-11-05 11:36:24 +03:00
parent e693a98bd4
commit d12177befd
50 changed files with 624 additions and 462 deletions

View File

@@ -35,7 +35,7 @@ void BlueTitleShadow::paintEvent(QPaintEvent *e) {
st::boxBlueTitleShadow.fill(p, QRect(r.left(), 0, r.width(), height()));
}
AbstractBox::AbstractBox(int w) : LayerWidget() {
AbstractBox::AbstractBox(int w) : LayerWidget(App::wnd()->bodyWidget()) {
setAttribute(Qt::WA_OpaquePaintEvent);
resize(w, 0);
}
@@ -64,8 +64,9 @@ void AbstractBox::resizeEvent(QResizeEvent *e) {
}
void AbstractBox::parentResized() {
int32 newHeight = countHeight();
setGeometry((App::wnd()->width() - width()) / 2, (App::wnd()->height() - newHeight) / 2, width(), newHeight);
auto newHeight = countHeight();
auto parentSize = parentWidget()->size();
setGeometry((parentSize.width() - width()) / 2, (parentSize.height() - newHeight) / 2, width(), newHeight);
update();
}
@@ -123,7 +124,7 @@ void AbstractBox::resizeMaxHeight(int32 newWidth, int32 maxHeight) {
}
int AbstractBox::countHeight() const {
return qMin(_maxHeight, App::wnd()->height() - 2 * st::boxVerticalMargin);
return qMin(_maxHeight, parentWidget()->height() - 2 * st::boxVerticalMargin);
}
void AbstractBox::onClose() {
@@ -163,7 +164,6 @@ void ScrollableBox::init(TWidget *inner, int bottomSkip, int topSkip) {
_bottomSkip = bottomSkip;
_topSkip = topSkip;
_scroll->setOwnedWidget(inner);
_scroll->setFocusPolicy(Qt::NoFocus);
updateScrollGeometry();
}

View File

@@ -854,7 +854,8 @@ void ContactsBox::Inner::peerUpdated(PeerData *peer) {
}
void ContactsBox::Inner::loadProfilePhotos(int32 yFrom) {
int32 yTo = yFrom + (parentWidget() ? parentWidget()->height() : App::wnd()->height()) * 5;
if (!parentWidget()) return;
int32 yTo = yFrom + parentWidget()->height() * 5;
MTP::clearLoaderPriorities();
if (yTo < 0) return;

View File

@@ -310,7 +310,8 @@ void MembersBox::Inner::selectSkipPage(int32 h, int32 dir) {
}
void MembersBox::Inner::loadProfilePhotos(int32 yFrom) {
int32 yTo = yFrom + (parentWidget() ? parentWidget()->height() : App::wnd()->height()) * 5;
if (!parentWidget()) return;
int32 yTo = yFrom + parentWidget()->height() * 5;
MTP::clearLoaderPriorities();
if (yTo < 0) return;

View File

@@ -427,13 +427,14 @@ int ShareBox::Inner::chatIndex(PeerData *peer) const {
}
void ShareBox::Inner::loadProfilePhotos(int yFrom) {
if (!parentWidget()) return;
if (yFrom < 0) {
yFrom = 0;
}
if (auto part = (yFrom % _rowHeight)) {
yFrom -= part;
}
int yTo = yFrom + (parentWidget() ? parentWidget()->height() : App::wnd()->height()) * 5 * _columnCount;
int yTo = yFrom + parentWidget()->height() * 5 * _columnCount;
if (!yTo) {
return;
}