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)
: _owner(owner)
, _cache(cache) {
const QSize size(
setFixedSize(
cache.width() / cache.devicePixelRatio(),
cache.height() / cache.devicePixelRatio());
resize(size);
setMinimumSize(size);
setMaximumSize(size);
setWindowFlags(Qt::WindowFlags(Qt::FramelessWindowHint)
| Qt::WindowStaysOnTopHint
| Qt::BypassWindowManagerHint

View File

@ -586,9 +586,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));
move(x, y);
setFixedSize(width, height);
update();
}