diff options
Diffstat (limited to 'src/modules/notifier/notifierwindow.cpp')
-rw-r--r-- | src/modules/notifier/notifierwindow.cpp | 107 |
1 files changed, 1 insertions, 106 deletions
diff --git a/src/modules/notifier/notifierwindow.cpp b/src/modules/notifier/notifierwindow.cpp index 290daaef..25afa711 100644 --- a/src/modules/notifier/notifierwindow.cpp +++ b/src/modules/notifier/notifierwindow.cpp @@ -23,16 +23,8 @@ //================================================================================== #include "kvi_settings.h" -#ifdef COMPILE_USE_QT4 - #define TQPopupMenu Q3PopupMenu - #define TQSimpleRichText Q3SimpleRichText - - #include <tq3popupmenu.h> - #include <tq3simplerichtext.h> -#else #include <tqpopupmenu.h> #include <tqsimplerichtext.h> -#endif #include <tqpainter.h> @@ -127,11 +119,7 @@ KviNotifierWindow::KviNotifierWindow() if(m_iInputHeight < 10)m_iInputHeight = 10; setBackgroundMode(TQt::NoBackground); -#ifdef COMPILE_USE_QT4 setFocusPolicy(TQ_NoFocus); -#else - setFocusPolicy(TQ_NoFocus); -#endif setMouseTracking(true); //setCursor(m_cursor); @@ -325,14 +313,12 @@ void KviNotifierWindow::doShow(bool bDoAnimate) m_bNextDown = false; m_bWriteDown = false; m_bBlinkOn = false; - #if (!defined COMPILE_USE_QT4) || !(defined(COMPILE_USE_QT4) && (defined(COMPILE_ON_WINDOWS) || defined(Q_OS_MACX))) m_imgDesktop = TQPixmap(TQPixmap::grabWindow( TQApplication::desktop()->winId(), m_wndRect.x(), m_wndRect.y(), m_wndRect.width(), m_wndRect.height())).convertToImage(); - #endif // TQPixmap tmp = TQPixmap::grabWindow( TQApplication::desktop()->winId(),m_wndRect.x(), m_wndRect.y(), m_wndRect.width(), m_wndRect.height()); // tmp.save("/root/pix.png","PNG"); m_pixForeground.resize(m_pixBackground.size()); @@ -344,15 +330,8 @@ void KviNotifierWindow::doShow(bool bDoAnimate) m_dOpacity = OPACITY_STEP; m_eState = Showing; m_bCrashShowWorkAround=true; - #if defined(COMPILE_USE_QT4) && (defined(COMPILE_ON_WINDOWS) || defined(Q_OS_MACX)) - setWindowOpacity(m_dOpacity); - #endif show(); - #if defined(COMPILE_USE_QT4) && (defined(COMPILE_ON_WINDOWS) || defined(Q_OS_MACX)) - m_pShowHideTimer->start(40); - #else m_pShowHideTimer->start(100); - #endif computeRect(); m_bCrashShowWorkAround=false; //show(); @@ -382,7 +361,7 @@ void KviNotifierWindow::heartbeat() { bool bIncreasing; - double targetOpacity = 0; //qt4 + double targetOpacity = 0; switch(m_eState) { case Hidden: @@ -401,18 +380,9 @@ void KviNotifierWindow::heartbeat() m_eState = Hiding; } else { m_dOpacity += OPACITY_STEP; -#ifdef COMPILE_USE_QT4 - targetOpacity = isActiveWindow() ? KVI_OPTION_UINT(KviOption_uintNotifierActiveTransparency) : KVI_OPTION_UINT(KviOption_uintNotifierInactiveTransparency); - - targetOpacity/=100; - if(m_dOpacity >= targetOpacity) - { - m_dOpacity = targetOpacity; -#else if(m_dOpacity >= 1.0) { m_dOpacity = 1.0; -#endif m_eState = Visible; stopShowHideTimer(); startBlinking(); @@ -421,54 +391,12 @@ void KviNotifierWindow::heartbeat() if(!isVisible())show(); //!!! if(m_pLineEdit->isVisible())m_pLineEdit->hide(); - #if defined(COMPILE_USE_QT4) && (defined(COMPILE_ON_WINDOWS) || defined(Q_OS_MACX)) - setWindowOpacity(m_dOpacity); - #endif update(); } break; -#ifdef COMPILE_USE_QT4 - case FocusingOn: - targetOpacity = KVI_OPTION_UINT(KviOption_uintNotifierActiveTransparency); - targetOpacity/=100; - bIncreasing = targetOpacity>m_dOpacity; - m_dOpacity += bIncreasing? - OPACITY_STEP : -(OPACITY_STEP); - if( (bIncreasing && (m_dOpacity >= targetOpacity) ) || - (!bIncreasing && (m_dOpacity <= targetOpacity) ) - ) - { - m_dOpacity = targetOpacity; - m_eState = Visible; - stopShowHideTimer(); - } - - setWindowOpacity(m_dOpacity); - break; - case FocusingOff: - targetOpacity = KVI_OPTION_UINT(KviOption_uintNotifierInactiveTransparency); - targetOpacity/=100; - bIncreasing = targetOpacity>m_dOpacity; - m_dOpacity += bIncreasing ? OPACITY_STEP : -(OPACITY_STEP); - //tqDebug("%f %f %i %i",m_dOpacity,targetOpacity,bIncreasing,(m_dOpacity >= targetOpacity)); - if( (bIncreasing && (m_dOpacity >= targetOpacity) ) || - (!bIncreasing && (m_dOpacity <= targetOpacity) ) - ) - { - m_dOpacity = targetOpacity; - m_eState = Visible; - stopShowHideTimer(); - } - - setWindowOpacity(m_dOpacity); - break; -#endif case Hiding: m_dOpacity -= OPACITY_STEP; - #if defined(COMPILE_USE_QT4) && (defined(COMPILE_ON_WINDOWS) || defined(Q_OS_MACX)) - setWindowOpacity(m_dOpacity); - #endif if(m_pLineEdit->isVisible())m_pLineEdit->hide(); if(m_dOpacity <= 0.0)hideNow(); else update(); @@ -530,16 +458,8 @@ void KviNotifierWindow::doHide(bool bDoAnimate) connect(m_pShowHideTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(heartbeat())); m_dOpacity = 1.0 - OPACITY_STEP; m_eState = Hiding; - #if defined(COMPILE_USE_QT4) && (defined(COMPILE_ON_WINDOWS) || defined(Q_OS_MACX)) - setWindowOpacity(m_dOpacity); - update(); - m_pShowHideTimer->start(40); - #else update(); m_pShowHideTimer->start(100); - #endif - - } break; } @@ -676,21 +596,12 @@ void KviNotifierWindow::paintEvent(TQPaintEvent * e) { TQPainter px(this); - #if defined(COMPILE_USE_QT4) && (defined(COMPILE_ON_WINDOWS) || defined(Q_OS_MACX)) - px.drawPixmap(0,0,m_pixForeground); - #else TQImage temp_image = m_pixForeground.convertToImage(); blend_images(m_imgBuffer,m_imgDesktop,temp_image,m_dOpacity); px.drawImage(0,0,m_imgBuffer); - #endif px.end(); } else { -#ifdef COMPILE_USE_QT4 - TQPainter px(this); - px.drawPixmap(0,0,m_pixForeground); -#else bitBlt(this,TQPoint(0,0),&m_pixForeground); -#endif } } @@ -1201,14 +1112,6 @@ inline void KviNotifierWindow::setCursor(int cur) { void KviNotifierWindow::enterEvent(TQEvent * e) { -#ifdef COMPILE_USE_QT4 - if(!m_pShowHideTimer) { - m_pShowHideTimer = new TQTimer(); - connect(m_pShowHideTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(heartbeat())); - } - m_eState = FocusingOn; - m_pShowHideTimer->start(40); -#endif } void KviNotifierWindow::leaveEvent(TQEvent * e) @@ -1218,14 +1121,6 @@ void KviNotifierWindow::leaveEvent(TQEvent * e) m_pWndTabs->resetIcons(); if (!m_bResizing) setCursor(-1); -#ifdef COMPILE_USE_QT4 - if(!m_pShowHideTimer) { - m_pShowHideTimer = new TQTimer(); - connect(m_pShowHideTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(heartbeat())); - } - m_eState = FocusingOff; - m_pShowHideTimer->start(40); -#endif } void KviNotifierWindow::contextPopup(const TQPoint &pos) |