diff options
| author | 2007-06-06 05:37:03 +0000 | |
|---|---|---|
| committer | 2007-06-06 05:37:03 +0000 | |
| commit | 2d250bf64eb08df60b3149e53fc839a857d47496 (patch) | |
| tree | 69b17d66c8c9d14e0d892c83ab1bcfcb9d6acce8 /src/modules | |
| parent | *AUTOMATICALLY* updated KVI_SOURCES_DATE variable (diff) | |
| download | KVIrc-2d250bf64eb08df60b3149e53fc839a857d47496.tar.gz KVIrc-2d250bf64eb08df60b3149e53fc839a857d47496.tar.bz2 KVIrc-2d250bf64eb08df60b3149e53fc839a857d47496.zip | |
fixes/improvements
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@601 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/actioneditor/actioneditor.cpp | 2 | ||||
| -rw-r--r-- | src/modules/notifier/notifiersettings.h | 2 | ||||
| -rw-r--r-- | src/modules/notifier/notifierwindow.cpp | 69 | ||||
| -rw-r--r-- | src/modules/notifier/notifierwindow.h | 1 |
4 files changed, 71 insertions, 3 deletions
diff --git a/src/modules/actioneditor/actioneditor.cpp b/src/modules/actioneditor/actioneditor.cpp index 022fb8725..f4f345737 100644 --- a/src/modules/actioneditor/actioneditor.cpp +++ b/src/modules/actioneditor/actioneditor.cpp @@ -401,7 +401,7 @@ void KviSingleActionEditor::chooseBigIcon() QString s = d->selectedImage(); delete d; if(ret != QDialog::Accepted)return; - QPixmap * p = g_pIconManager->getBigIcon(s.utf8().data()); + QPixmap * p = g_pIconManager->getBigIcon(s); if(!p)return; m_pBigIconEdit->setText(s); m_pBigIconButton->setPixmap(*p); diff --git a/src/modules/notifier/notifiersettings.h b/src/modules/notifier/notifiersettings.h index fe06b9b9e..50ff2aa5d 100644 --- a/src/modules/notifier/notifiersettings.h +++ b/src/modules/notifier/notifiersettings.h @@ -60,7 +60,7 @@ #define m_mac_bkgColor QColor(236,233,216) // Light-brown color of notifier background widget -enum State { Hidden, Showing, Visible, Hiding }; +enum State { Hidden, Showing, Visible, Hiding , FocusingOff, FocusingOn }; enum TabState { Normal, Highlighted, Changed }; #endif //_NOTIFIER_SETTINGS_H_ diff --git a/src/modules/notifier/notifierwindow.cpp b/src/modules/notifier/notifierwindow.cpp index 94ced105e..305053cd9 100644 --- a/src/modules/notifier/notifierwindow.cpp +++ b/src/modules/notifier/notifierwindow.cpp @@ -382,6 +382,8 @@ bool KviNotifierWindow::shouldHideIfMainWindowGotAttention() void KviNotifierWindow::heartbeat() { + bool bIncreasing; + double targetOpacity = 0; //qt4 switch(m_eState) { case Hidden: @@ -400,9 +402,18 @@ 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(); @@ -418,6 +429,42 @@ void KviNotifierWindow::heartbeat() } 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); + debug("%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)) @@ -984,7 +1031,7 @@ void KviNotifierWindow::delayedRaiseSlot() m_pWindowToRaise->frame()->show(); m_pWindowToRaise->frame()->raise(); - ((QWidget *)(m_pWindowToRaise->frame()))->setActiveWindow(); + //((QWidget *)(m_pWindowToRaise->frame()))->setActiveWindow(); m_pWindowToRaise->frame()->setFocus(); } @@ -1153,6 +1200,18 @@ inline void KviNotifierWindow::setCursor(int cur) { if(QApplication::overrideCursor()) QApplication::restoreOverrideCursor(); } +void KviNotifierWindow::enterEvent(QEvent * e) +{ +#ifdef COMPILE_USE_QT4 + if(!m_pShowHideTimer) { + m_pShowHideTimer = new QTimer(); + connect(m_pShowHideTimer,SIGNAL(timeout()),this,SLOT(heartbeat())); + } + m_eState = FocusingOn; + m_pShowHideTimer->start(40); +#endif +} + void KviNotifierWindow::leaveEvent(QEvent * e) { // Leaving the widget area, restore default cursor @@ -1160,6 +1219,14 @@ void KviNotifierWindow::leaveEvent(QEvent * e) m_pWndTabs->resetIcons(); if (!m_bResizing) setCursor(-1); +#ifdef COMPILE_USE_QT4 + if(!m_pShowHideTimer) { + m_pShowHideTimer = new QTimer(); + connect(m_pShowHideTimer,SIGNAL(timeout()),this,SLOT(heartbeat())); + } + m_eState = FocusingOff; + m_pShowHideTimer->start(40); +#endif } void KviNotifierWindow::contextPopup(const QPoint &pos) diff --git a/src/modules/notifier/notifierwindow.h b/src/modules/notifier/notifierwindow.h index bf01081df..8966089eb 100644 --- a/src/modules/notifier/notifierwindow.h +++ b/src/modules/notifier/notifierwindow.h @@ -148,6 +148,7 @@ protected: virtual void mouseReleaseEvent(QMouseEvent * e); virtual void mouseMoveEvent(QMouseEvent * e); virtual void leaveEvent(QEvent * e); + virtual void enterEvent(QEvent * e); virtual void mouseDoubleClickEvent(QMouseEvent * e); virtual void wheelEvent(QWheelEvent * e); virtual bool eventFilter(QObject * pEdit,QEvent * e); |
