2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +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

@@ -142,7 +142,8 @@ Widget::Widget(QWidget *parent) : LayerWidget(parent)
}
void Widget::parentResized() {
int windowWidth = App::wnd()->width();
auto parentSize = parentWidget()->size();
int windowWidth = parentSize.width();
int newWidth = st::settingsMaxWidth;
int newContentLeft = st::settingsMaxPadding;
if (windowWidth <= st::settingsMaxWidth) {
@@ -177,8 +178,9 @@ void Widget::onInnerHeightUpdated() {
void Widget::resizeUsingInnerHeight(int newWidth, int newContentLeft) {
if (!App::wnd()) return;
int windowWidth = App::wnd()->width();
int windowHeight = App::wnd()->height();
auto parentSize = parentWidget()->size();
int windowWidth = parentSize.width();
int windowHeight = parentSize.height();
int maxHeight = st::settingsFixedBarHeight + _inner->height();
int newHeight = maxHeight;
if (newHeight > windowHeight || newWidth >= windowWidth) {
@@ -189,7 +191,7 @@ void Widget::resizeUsingInnerHeight(int newWidth, int newContentLeft) {
_contentLeft = newContentLeft;
}
setGeometry((App::wnd()->width() - newWidth) / 2, (App::wnd()->height() - newHeight) / 2, newWidth, newHeight);
setGeometry((windowWidth - newWidth) / 2, (windowHeight - newHeight) / 2, newWidth, newHeight);
update();
}