diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-09-02 12:34:31 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-09-25 16:12:55 +0200 |
commit | cc3875c2e463be5cf126a18637295a0c56358eda (patch) | |
tree | 41d513ec1c8726e51f017746774041a978bea107 /src/widgets/util/qsystemtrayicon.cpp | |
parent | 568c26227d09b48fa6066f74d9dfa5d844073a5c (diff) |
Balloon tip must follow systemtray icon
If the a message notification is created at the same time as the system
tray icon is embedded it may start at a wrong location, since the icon
location it bases its own location is not yet final.
This patch adds code to update the balloon tip location when the system
tray icon is moved or resized.
The bug and fix can be tested by the systray example by disabling the
icon and letting show message trigger both showing it and the message.
Change-Id: Ie1dc10489ad420e581e32afeb757c236fb5129ab
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/widgets/util/qsystemtrayicon.cpp')
-rw-r--r-- | src/widgets/util/qsystemtrayicon.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/widgets/util/qsystemtrayicon.cpp b/src/widgets/util/qsystemtrayicon.cpp index 6b8c878dc4..7d04cab05e 100644 --- a/src/widgets/util/qsystemtrayicon.cpp +++ b/src/widgets/util/qsystemtrayicon.cpp @@ -416,6 +416,14 @@ void QBalloonTip::hideBalloon() theSolitaryBalloonTip = 0; } +void QBalloonTip::updateBalloonPosition(const QPoint& pos) +{ + if (!theSolitaryBalloonTip) + return; + theSolitaryBalloonTip->hide(); + theSolitaryBalloonTip->balloon(pos, 0, theSolitaryBalloonTip->showArrow); +} + bool QBalloonTip::isBalloonVisible() { return theSolitaryBalloonTip; @@ -549,6 +557,7 @@ void QBalloonTip::resizeEvent(QResizeEvent *ev) void QBalloonTip::balloon(const QPoint& pos, int msecs, bool showArrow) { + this->showArrow = showArrow; QRect scr = QApplication::desktop()->screenGeometry(pos); QSize sh = sizeHint(); const int border = 1; |