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

@@ -63,7 +63,8 @@ void AdvancedWidget::createControls() {
if (self()) {
addChildRow(_askQuestion, marginSmall, lang(lng_settings_ask_question), SLOT(onAskQuestion()));
}
addChildRow(_telegramFAQ, marginLarge, lang(lng_settings_faq), SLOT(onTelegramFAQ()));
addChildRow(_telegramFAQ, marginSmall, lang(lng_settings_faq), SLOT(onTelegramFAQ()));
addChildRow(_about, marginLarge, lang(lng_menu_about), SLOT(onAbout()));
if (self()) {
style::margins marginLogout(0, 0, 0, 2 * st::settingsLargeSkip);
addChildRow(_logOut, marginLogout, lang(lng_settings_logout), SLOT(onLogOut()));
@@ -123,6 +124,10 @@ void AdvancedWidget::onTelegramFAQ() {
QDesktopServices::openUrl(telegramFaqLink());
}
void AdvancedWidget::onAbout() {
Ui::showLayer(new AboutBox());
}
void AdvancedWidget::onLogOut() {
App::wnd()->onLogout();
}

View File

@@ -39,6 +39,7 @@ private slots:
void onAskQuestion();
void onAskQuestionSure();
void onTelegramFAQ();
void onAbout();
void onLogOut();
private:
@@ -54,6 +55,7 @@ private:
#endif // !TDESKTOP_DISABLE_NETWORK_PROXY
ChildWidget<LinkButton> _askQuestion = { nullptr };
ChildWidget<LinkButton> _telegramFAQ = { nullptr };
ChildWidget<LinkButton> _about = { nullptr };
ChildWidget<LinkButton> _logOut = { nullptr };
mtpRequestId _supportGetRequest = 0;

View File

@@ -42,9 +42,6 @@ public:
void showFinished();
signals:
void heightUpdated();
private slots:
void onBlockHeightUpdated();

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();
}