mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Add an 'Update your OS' top bar.
Set EOL for Windows XP / Vista version at September 1, 2019.
This commit is contained in:
@@ -14,6 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "window/themes/window_theme.h"
|
||||
#include "window/window_controller.h"
|
||||
#include "window/window_lock_widgets.h"
|
||||
#include "window/window_outdated_bar.h"
|
||||
#include "boxes/confirm_box.h"
|
||||
#include "core/click_handler_types.h"
|
||||
#include "core/application.h"
|
||||
@@ -108,6 +109,7 @@ QIcon CreateIcon() {
|
||||
|
||||
MainWindow::MainWindow()
|
||||
: _positionUpdatedTimer([=] { savePosition(); })
|
||||
, _outdated(CreateOutdatedBar(this))
|
||||
, _body(this)
|
||||
, _icon(CreateIcon())
|
||||
, _titleText(qsl("Telegram")) {
|
||||
@@ -134,6 +136,18 @@ MainWindow::MainWindow()
|
||||
checkLockByTerms();
|
||||
}, lifetime());
|
||||
|
||||
if (_outdated) {
|
||||
_outdated->heightValue(
|
||||
) | rpl::filter([=] {
|
||||
return window()->windowHandle() != nullptr;
|
||||
}) | rpl::start_with_next([=](int height) {
|
||||
if (!height) {
|
||||
crl::on_main(this, [=] { _outdated.destroy(); });
|
||||
}
|
||||
updateControlsGeometry();
|
||||
}, _outdated->lifetime());
|
||||
}
|
||||
|
||||
_isActiveTimer.setCallback([this] { updateIsActive(0); });
|
||||
_inactivePressTimer.setCallback([this] { setInactivePress(false); });
|
||||
}
|
||||
@@ -341,7 +355,14 @@ HitTestResult MainWindow::hitTest(const QPoint &p) const {
|
||||
|
||||
int MainWindow::computeMinHeight() const {
|
||||
const auto title = _title ? _title->height() : 0;
|
||||
return title + st::windowMinHeight;
|
||||
const auto outdated = [&] {
|
||||
if (!_outdated) {
|
||||
return 0;
|
||||
}
|
||||
_outdated->resizeToWidth(st::windowMinWidth);
|
||||
return _outdated->height();
|
||||
}();
|
||||
return title + outdated + st::windowMinHeight;
|
||||
}
|
||||
|
||||
void MainWindow::initSize() {
|
||||
@@ -446,6 +467,12 @@ void MainWindow::updateControlsGeometry() {
|
||||
_title->setGeometry(0, bodyTop, width(), _title->height());
|
||||
bodyTop += _title->height();
|
||||
}
|
||||
if (_outdated) {
|
||||
Ui::SendPendingMoveResizeEvents(_outdated.data());
|
||||
_outdated->resizeToWidth(width());
|
||||
_outdated->moveToLeft(0, bodyTop);
|
||||
bodyTop += _outdated->height();
|
||||
}
|
||||
if (_rightColumn) {
|
||||
bodyWidth -= _rightColumn->width();
|
||||
_rightColumn->setGeometry(bodyWidth, bodyTop, width() - bodyWidth, height() - bodyTop);
|
||||
|
Reference in New Issue
Block a user