diff --git a/Telegram/SourceFiles/settings/settings_notifications.cpp b/Telegram/SourceFiles/settings/settings_notifications.cpp index e4e456e27..ccc0f867d 100644 --- a/Telegram/SourceFiles/settings/settings_notifications.cpp +++ b/Telegram/SourceFiles/settings/settings_notifications.cpp @@ -431,13 +431,17 @@ NotificationsCount::~NotificationsCount() { NotificationsCount::SampleWidget::SampleWidget( NotificationsCount *owner, const QPixmap &cache) -: QWidget(nullptr) +: QWidget(App::wnd()) , _owner(owner) , _cache(cache) { - resize( + const QSize size( cache.width() / cache.devicePixelRatio(), cache.height() / cache.devicePixelRatio()); + resize(size); + setMinimumSize(size); + setMaximumSize(size); + setWindowFlags(Qt::WindowFlags(Qt::FramelessWindowHint) | Qt::WindowStaysOnTopHint | Qt::BypassWindowManagerHint diff --git a/Telegram/SourceFiles/window/notifications_manager_default.cpp b/Telegram/SourceFiles/window/notifications_manager_default.cpp index b70b25fe3..f3349d8a8 100644 --- a/Telegram/SourceFiles/window/notifications_manager_default.cpp +++ b/Telegram/SourceFiles/window/notifications_manager_default.cpp @@ -27,6 +27,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "base/call_delayed.h" #include "facades.h" #include "app.h" +#include "mainwindow.h" #include "styles/style_dialogs.h" #include "styles/style_layers.h" #include "styles/style_window.h" @@ -374,7 +375,7 @@ Widget::Widget( QPoint startPosition, int shift, Direction shiftDirection) -: TWidget(nullptr) +: TWidget(App::wnd()) , _manager(manager) , _startPosition(startPosition) , _direction(shiftDirection) @@ -488,6 +489,8 @@ void Widget::addToHeight(int add) { void Widget::updateGeometry(int x, int y, int width, int height) { setGeometry(x, y, width, height); + setMinimumSize(QSize(width, height)); + setMaximumSize(QSize(width, height)); update(); }