2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 22:46:10 +00:00

Alpha version 0.10.22: critical bug fixes.

This commit is contained in:
John Preston
2016-12-31 17:34:41 +04:00
parent bc0c355d2d
commit 218f991547
42 changed files with 634 additions and 212 deletions

View File

@@ -32,12 +32,12 @@ MainWindow::MainWindow() : QWidget()
, _positionUpdatedTimer(this)
, _body(this)
, _titleText(qsl("Telegram")) {
using Update = Theme::BackgroundUpdate;
subscribe(Theme::Background(), [this](const Update &data) {
subscribe(Theme::Background(), [this](const Theme::BackgroundUpdate &data) {
if (data.paletteChanged()) {
if (_title) {
_title->update();
}
updatePalette();
}
});
subscribe(Global::RefUnreadCounterUpdate(), [this] { updateUnreadCounter(); });
@@ -49,9 +49,7 @@ void MainWindow::init() {
_positionUpdatedTimer->setSingleShot(true);
connect(_positionUpdatedTimer, SIGNAL(timeout()), this, SLOT(savePositionByTimer()));
auto p = palette();
p.setColor(QPalette::Window, st::windowBg->c);
setPalette(p);
updatePalette();
if ((_title = Platform::CreateTitleWidget(this))) {
_title->init();
@@ -61,6 +59,12 @@ void MainWindow::init() {
updateUnreadCounter();
}
void MainWindow::updatePalette() {
auto p = palette();
p.setColor(QPalette::Window, st::windowBg->c);
setPalette(p);
}
HitTestResult MainWindow::hitTest(const QPoint &p) const {
auto titleResult = _title ? _title->hitTest(p - _title->geometry().topLeft()) : Window::HitTestResult::None;
if (titleResult != Window::HitTestResult::None) {