Commit c9381033 authored by Bartosz Brachaczek's avatar Bartosz Brachaczek

hints: Further fixes to hints positioning

Now it seems to work correctly also on Windows. What a nightmare...
Signed-off-by: 's avatarBartosz Brachaczek <b.brachaczek@gmail.com>
parent 2deb1e1b
......@@ -94,7 +94,7 @@ Hint::Hint(QWidget *parent, Notification *notification)
connect(notification, SIGNAL(closed(Notification *)), this, SLOT(notificationClosed()));
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Ignored);
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
configurationUpdated();
updateText();
......
......@@ -177,6 +177,7 @@ void HintManager::setHint()
QPoint newPosition;
QPoint trayPosition;
frame->adjustSize();
QSize preferredSize = frame->sizeHint();
if (preferredSize.width() < minimumWidth)
preferredSize.setWidth(minimumWidth);
......@@ -239,10 +240,11 @@ void HintManager::setHint()
newPosition.setY(trayPosition.y() - preferredSize.height());
}
frame->setGeometry(newPosition.x(), newPosition.y(), preferredSize.width(), preferredSize.height());
// Without this sometimes frames is bigger than hints inside it and it looks really bad.
frame->setFixedSize(preferredSize);
frame->setWindowOpacity(Opacity);
// Only setFixedSize() and move() (in this order) guarantees correct
// placement on all platforms (at least those I tested).
frame->setFixedSize(preferredSize);
frame->move(newPosition);
if (frame->isVisible())
frame->update();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment