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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user