Commit 2deb1e1b authored by Bartosz Brachaczek's avatar Bartosz Brachaczek

hints: Fix issues with incorrect positioning hints frame on Qt 4.8

Probably still problematic with Qt 4.7, I will check it in a moment.

Regression since 0416ab79.
Signed-off-by: 's avatarBartosz Brachaczek <b.brachaczek@gmail.com>
parent fa2f3f82
+++ version 0.11.0-beta3
* hints: #2266 fixed: restored word wraping in hints (Vogel)
* hints: #2266 fixed: restored word wraping in hints (Vogel, beevvy)
* sms: #2394 fixed: Orange Multibox SMS length limit is not ignored in Send SMS window anymore (Vogel)
* sms: #2371 fixed: allow foreign SMS numbers (Vogel)
* sms: #1664 fixed: support automatic gateway selection when +48 prefix is used (Vogel)
......
......@@ -66,7 +66,6 @@ Hint::Hint(QWidget *parent, Notification *notification)
startSecs = secs = config_file.readNumEntry("Hints", "Event_" + notification->key() + "_timeout", 10);
createLabels(notification->icon().icon().pixmap(config_file.readNumEntry("Hints", "AllEvents_iconSize", 32)));
updateText();
const QList<Notification::Callback> callbacks = notification->getCallbacks();
bool showButtons = !callbacks.isEmpty();
......@@ -95,9 +94,10 @@ Hint::Hint(QWidget *parent, Notification *notification)
connect(notification, SIGNAL(closed(Notification *)), this, SLOT(notificationClosed()));
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Ignored);
configurationUpdated();
updateText();
show();
kdebugf2();
......@@ -124,6 +124,7 @@ void Hint::configurationUpdated()
setMinimumWidth(config_file.readNumEntry("Hints", "MinimumWidth", 100));
setMaximumWidth(config_file.readNumEntry("Hints", "MaximumWidth", 500));
mouseOut();
updateText();
}
void Hint::createLabels(const QPixmap &pixmap)
......@@ -150,7 +151,7 @@ void Hint::createLabels(const QPixmap &pixmap)
}
label = new QLabel(this);
label->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::MinimumExpanding);
label->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Ignored);
label->setTextInteractionFlags(Qt::NoTextInteraction);
label->setAlignment(Qt::AlignVCenter | Qt::AlignLeft);
label->setWordWrap(true);
......
......@@ -177,7 +177,6 @@ void HintManager::setHint()
QPoint newPosition;
QPoint trayPosition;
frame->adjustSize();
QSize preferredSize = frame->sizeHint();
if (preferredSize.width() < minimumWidth)
preferredSize.setWidth(minimumWidth);
......@@ -241,7 +240,8 @@ void HintManager::setHint()
}
frame->setGeometry(newPosition.x(), newPosition.y(), preferredSize.width(), preferredSize.height());
frame->setFixedWidth(preferredSize.width());
// Without this sometimes frames is bigger than hints inside it and it looks really bad.
frame->setFixedSize(preferredSize);
frame->setWindowOpacity(Opacity);
if (frame->isVisible())
......
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