[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/workspace/plasma/applets/pager
From: Davide Bettio <davbet () aliceposta ! it>
Date: 2008-11-11 21:58:47
Message-ID: 1226440727.825471.24806.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 883020 by bettio:
As first thing I add pager's tooltip with desktop's name.
(Actualy I'm trying to get tooltips similiar to tooltips used in kicker's pager.)
M +18 -0 pager.cpp
M +1 -0 pager.h
--- trunk/KDE/kdebase/workspace/plasma/applets/pager/pager.cpp #883019:883020
@@ -44,6 +44,7 @@
#include <Plasma/FrameSvg>
#include <Plasma/PaintUtils>
#include <Plasma/Theme>
+#include <Plasma/ToolTipManager>
#include <Plasma/Animator>
const int FAST_UPDATE_DELAY = 200;
@@ -753,6 +754,7 @@
m_animations[m_hoverIndex].alpha = 0;
m_animations[m_hoverIndex].animId = anim->customAnimation(40 / (1000 \
/ s_FadeInDuration), s_FadeInDuration,Plasma::Animator::EaseInCurve, \
this,"animationUpdate"); update();
+ updateToolTip();
}
return;
}
@@ -1068,4 +1070,20 @@
m_colorScheme = 0;
}
+void Pager::updateToolTip()
+{
+ int hoverDesktopNumber;
+
+ for (int i = 0; i < m_desktopCount; i++) {
+ if (m_rects[i] == m_hoverRect) {
+ hoverDesktopNumber = i + 1;
+ }
+ }
+
+ Plasma::ToolTipContent data;
+ data.setMainText(KWindowSystem::desktopName(hoverDesktopNumber));
+
+ Plasma::ToolTipManager::self()->setContent(this, data);
+}
+
#include "pager.moc"
--- trunk/KDE/kdebase/workspace/plasma/applets/pager/pager.h #883019:883020
@@ -90,6 +90,7 @@
bool posOnDesktopRect(const QRectF& r, const QPointF& pos);
void handleHoverMove(const QPointF& pos);
void handleHoverLeave();
+ void updateToolTip();
private:
QTimer* m_timer;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic