Ignore:
Timestamp:
Nov 3, 2009, 3:59:46 AM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

gui: QSystemTrayIcon: Implemented showMessage() using the fallback code (Qt-drawn balloons).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/util/qsystemtrayicon_pm.cpp

    r283 r286  
    118118QRect QSystemTrayIconSys::geometry()
    119119{
    120     // @todo use xstQuerySysTrayIconRect()
    121     return QRect();
     120    QRect rect;
     121    RECTL rcl;
     122    if (xstQuerySysTrayIconRect(winId(), 0, &rcl)) {
     123        int sh = QApplication::desktop()->height();
     124        // flip y coordinates
     125        rcl.yTop = sh - rcl.yTop;
     126        rcl.yBottom = sh - rcl.yBottom;
     127        rect.setCoords(rcl.xLeft, rcl.yTop, rcl.xRight, rcl.yBottom);
     128    }
     129    return rect;
    122130}
    123131
     
    137145                                     QSystemTrayIcon::MessageIcon type, int timeOut)
    138146{
    139     // @todo use xstShowSysTrayIconBalloon()
     147    uint uSecs = 0;
     148    if ( timeOut < 0)
     149        uSecs = 10000; //10 sec default
     150    else uSecs = (int)timeOut;
     151
     152    // so far, we use fallbacks
     153    // @todo use xstShowSysTrayIconBalloon() when it's implemented
     154    QRect iconPos = geometry();
     155    if (iconPos.isValid()) {
     156        QBalloonTip::showBalloon(type, title, message, q, iconPos.center(), uSecs, true);
     157    }
    140158}
    141159
Note: See TracChangeset for help on using the changeset viewer.