Use setFixedSize instead of set{Minimum,Maximum}Size combo

This commit is contained in:
Ilya Fedin 2023-11-19 01:30:44 +04:00 committed by John Preston
parent cfc254bd90
commit 0f9d83f34b
2 changed files with 3 additions and 8 deletions

View file

@ -610,14 +610,10 @@ NotificationsCount::SampleWidget::SampleWidget(
const QPixmap &cache) const QPixmap &cache)
: _owner(owner) : _owner(owner)
, _cache(cache) { , _cache(cache) {
const QSize size( setFixedSize(
cache.width() / cache.devicePixelRatio(), cache.width() / cache.devicePixelRatio(),
cache.height() / cache.devicePixelRatio()); cache.height() / cache.devicePixelRatio());
resize(size);
setMinimumSize(size);
setMaximumSize(size);
setWindowFlags(Qt::WindowFlags(Qt::FramelessWindowHint) setWindowFlags(Qt::WindowFlags(Qt::FramelessWindowHint)
| Qt::WindowStaysOnTopHint | Qt::WindowStaysOnTopHint
| Qt::BypassWindowManagerHint | Qt::BypassWindowManagerHint

View file

@ -586,9 +586,8 @@ void Widget::addToHeight(int add) {
} }
void Widget::updateGeometry(int x, int y, int width, int height) { void Widget::updateGeometry(int x, int y, int width, int height) {
setGeometry(x, y, width, height); move(x, y);
setMinimumSize(QSize(width, height)); setFixedSize(width, height);
setMaximumSize(QSize(width, height));
update(); update();
} }