summaryrefslogtreecommitdiffstats
path: root/kicker/libkicker/kickertip.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-03 20:49:48 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-03 20:49:48 +0000
commitfd7a608ffe99df747f0496300276b95f766c18b9 (patch)
treec54dfe97fb682af9705d2cb09c424c60db861228 /kicker/libkicker/kickertip.cpp
parent27856879bf962f178d88e79144e37a47e731b122 (diff)
downloadtdebase-fd7a608ffe99df747f0496300276b95f766c18b9.tar.gz
tdebase-fd7a608ffe99df747f0496300276b95f766c18b9.zip
* Added Kickoff menu
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1171422 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kicker/libkicker/kickertip.cpp')
-rw-r--r--kicker/libkicker/kickertip.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/kicker/libkicker/kickertip.cpp b/kicker/libkicker/kickertip.cpp
index 34cf65c56..215320c84 100644
--- a/kicker/libkicker/kickertip.cpp
+++ b/kicker/libkicker/kickertip.cpp
@@ -38,6 +38,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// putting this #include higher results in compile errors
#include <netwm.h>
+#include <assert.h>
static const int DEFAULT_FRAMES_PER_SECOND = 30;
@@ -71,14 +72,16 @@ KickerTip::KickerTip(TQWidget * parent)
m_dissolveDelta(-1),
m_direction(KPanelApplet::Up),
m_dirty(false),
- m_toolTipsEnabled(KickerSettings::showToolTips()),
- m_tippingFor(0)
+ m_tippingFor(0),
+ m_timer(0, "KickerTip::m_timer"),
+ m_frameTimer(0, "KickerTip::m_frameTimer")
{
setFocusPolicy(NoFocus);
setBackgroundMode(NoBackground);
resize(0, 0);
hide();
connect(&m_frameTimer, TQT_SIGNAL(timeout()), TQT_SLOT(internalUpdate()));
+ connect(kapp, TQT_SIGNAL(settingsChanged(SettingsCategory)), TQT_SLOT(slotSettingsChanged()));
}
KickerTip::~KickerTip()
@@ -87,6 +90,11 @@ KickerTip::~KickerTip()
delete m_mimeFactory;
}
+void KickerTip::slotSettingsChanged()
+{
+ TQToolTip::setGloballyEnabled(KickerSettings::showToolTips());
+}
+
void KickerTip::display()
{
if (!tippingEnabled())
@@ -194,7 +202,7 @@ void KickerTip::paintEvent(TQPaintEvent * e)
void KickerTip::mousePressEvent(TQMouseEvent * /*e*/)
{
- TQToolTip::setGloballyEnabled(m_toolTipsEnabled);
+ m_timer.stop();
hide();
}
@@ -463,8 +471,11 @@ void KickerTip::enableTipping(bool tip)
m_tippingEnabled--;
}
+ assert(m_tippingEnabled >= -1);
+
if (m_tippingEnabled < 1 && m_self)
{
+ m_self->m_timer.stop();
m_self->hide();
}
}
@@ -480,6 +491,8 @@ void KickerTip::hide()
m_timer.stop();
m_frameTimer.stop();
TQWidget::hide();
+
+ TQToolTip::setGloballyEnabled(KickerSettings::showToolTips());
}
bool KickerTip::eventFilter(TQObject *object, TQEvent *event)
@@ -508,7 +521,6 @@ bool KickerTip::eventFilter(TQObject *object, TQEvent *event)
!qApp->activePopupWidget() &&
!isTippingFor(widget))
{
- m_toolTipsEnabled = TQToolTip::isGloballyEnabled();
TQToolTip::setGloballyEnabled(false);
tipFor(widget);
@@ -530,8 +542,6 @@ bool KickerTip::eventFilter(TQObject *object, TQEvent *event)
}
break;
case TQEvent::Leave:
- TQToolTip::setGloballyEnabled(m_toolTipsEnabled);
-
m_timer.stop();
if (isTippingFor(widget) && isVisible())
@@ -544,7 +554,7 @@ bool KickerTip::eventFilter(TQObject *object, TQEvent *event)
tipFor(0);
break;
case TQEvent::MouseButtonPress:
- TQToolTip::setGloballyEnabled(m_toolTipsEnabled);
+ m_timer.stop();
hide();
default:
break;