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

Buttons moved to ui/widgets/buttons module, BoxButton removed.

This commit is contained in:
John Preston
2016-11-11 16:46:04 +03:00
parent d4d1d438be
commit 807bebb3cf
133 changed files with 1300 additions and 1508 deletions

View File

@@ -25,6 +25,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
#include "styles/style_dialogs.h"
#include "styles/style_window.h"
#include "ui/widgets/popup_menu.h"
#include "ui/widgets/buttons.h"
#include "core/zlib_help.h"
#include "lang.h"
#include "shortcuts.h"
@@ -52,7 +53,7 @@ ConnectingWidget::ConnectingWidget(QWidget *parent, const QString &text, const Q
, _shadow(st::boxShadow)
, _reconnect(this, QString()) {
set(text, reconnect);
connect(&_reconnect, SIGNAL(clicked()), this, SLOT(onReconnect()));
connect(_reconnect, SIGNAL(clicked()), this, SLOT(onReconnect()));
}
void ConnectingWidget::set(const QString &text, const QString &reconnect) {
@@ -60,12 +61,12 @@ void ConnectingWidget::set(const QString &text, const QString &reconnect) {
_textWidth = st::linkFont->width(_text) + st::linkFont->spacew;
int32 _reconnectWidth = 0;
if (reconnect.isEmpty()) {
_reconnect.hide();
_reconnect->hide();
} else {
_reconnect.setText(reconnect);
_reconnect.show();
_reconnect.move(st::connectingPadding.left() + _textWidth, st::boxShadow.height() + st::connectingPadding.top());
_reconnectWidth = _reconnect.width();
_reconnect->setText(reconnect);
_reconnect->show();
_reconnect->move(st::connectingPadding.left() + _textWidth, st::boxShadow.height() + st::connectingPadding.top());
_reconnectWidth = _reconnect->width();
}
resize(st::connectingPadding.left() + _textWidth + _reconnectWidth + st::connectingPadding.right() + st::boxShadow.width(), st::boxShadow.height() + st::connectingPadding.top() + st::linkFont->height + st::connectingPadding.bottom());
update();