[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/kicker
From: Aaron J. Seigo <aseigo () kde ! org>
Date: 2005-08-02 5:16:00
Message-ID: 1122959760.643860.8069.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 442269 by aseigo:
some docu for KickerTip and improve the Client method names
M +1 -1 applets/launcher/quickbutton.cpp
M +1 -1 applets/launcher/quickbutton.h
M +1 -1 applets/minipager/pagerbutton.cpp
M +1 -1 applets/minipager/pagerbutton.h
M +3 -3 libkicker/kickertip.cpp
M +55 -2 libkicker/kickertip.h
M +1 -1 libkicker/panelbutton.cpp
M +1 -1 libkicker/panelbutton.h
M +4 -4 taskbar/taskcontainer.cpp
M +1 -1 taskbar/taskcontainer.h
--- trunk/KDE/kdebase/kicker/applets/launcher/quickbutton.cpp #442268:442269
@@ -356,7 +356,7 @@
slotStickyToggled(sticky);
}
-void QuickButton::updateKickerTip(KickerTip::Data &data)
+void QuickButton::updateTipData(KickerTip::Data &data)
{
if (!_qurl)
{
--- trunk/KDE/kdebase/kicker/applets/launcher/quickbutton.h #442268:442269
@@ -103,7 +103,7 @@
void mouseMoveEvent(QMouseEvent *e);
void resizeEvent(QResizeEvent *rsevent);
void loadIcon();
- void updateKickerTip(KickerTip::Data &data);
+ void updateTipData(KickerTip::Data &data);
protected slots:
void settingsChanged(int);
--- trunk/KDE/kdebase/kicker/applets/minipager/pagerbutton.cpp #442268:442269
@@ -606,7 +606,7 @@
return QAbstractButton::eventFilter(o, e);
}
-void KMiniPagerButton::updateKickerTip(KickerTip::Data &data)
+void KMiniPagerButton::updateTipData(KickerTip::Data &data)
{
Task::Dict tasks = TaskManager::the()->tasks();
Task::Dict::iterator taskEnd = tasks.end();
--- trunk/KDE/kdebase/kicker/applets/minipager/pagerbutton.h #442268:442269
@@ -72,7 +72,7 @@
void dropEvent(QDropEvent* e);
bool eventFilter(QObject*, QEvent*);
- void updateKickerTip(KickerTip::Data &data);
+ void updateTipData(KickerTip::Data &data);
private slots:
void slotToggled(bool);
--- trunk/KDE/kdebase/kicker/libkicker/kickertip.cpp #442268:442269
@@ -46,7 +46,7 @@
KickerTip* KickerTip::m_self = 0;
int KickerTip::m_tippingEnabled = 1;
-void KickerTip::Client::updateKickerTip() const
+void KickerTip::Client::updateTip() const
{
if (KickerTip::the()->isTippingFor(dynamic_cast<const QWidget*>(this)) &&
KickerTip::the()->isVisible())
@@ -66,7 +66,7 @@
}
KickerTip::KickerTip(QWidget * parent)
- : QWidget(parent, "animtt",Qt::WX11BypassWM),
+ : QWidget(parent, "animtt", Qt::WX11BypassWM),
m_richText(0),
m_dissolveSize(0),
m_dissolveDelta(-1),
@@ -104,7 +104,7 @@
data.direction = Plasma::Up;
// Tickle the information out of the bastard.
- client->updateKickerTip(data);
+ client->updateTipData(data);
if (data.message.isEmpty() && data.subtext.isEmpty() && data.icon.isNull())
{
--- trunk/KDE/kdebase/kicker/libkicker/kickertip.h #442268:442269
@@ -46,8 +46,16 @@
Q_OBJECT
public:
+ /**
+ * The two visual effects available.
+ * Plain simply shows the tip, while Dissolve fades the tip in
+ */
enum MaskEffect { Plain, Dissolve };
+ /**
+ * Data contains the details for tip. A Data struct will be passed into
+ * the Client subclass whenever the tip needs to update its content
+ */
struct Data
{
QString message;
@@ -58,17 +66,39 @@
Plasma::Position direction;
};
+ /**
+ * For a widget to have a mouse over tip, simply have it subclass Client.
+ * Then call installEventFilter(KickerTip::the()); and the widget will be
+ * tracked by thetip
+ */
class KDE_EXPORT Client
{
public:
- virtual void updateKickerTip(KickerTip::Data&) = 0;
- void updateKickerTip() const;
+ virtual void updateTipData(KickerTip::Data&) = 0;
+ void updateTip() const;
};
+ /**
+ * Singleton accessor. Call this whenever you need to interact with the tip.
+ */
static KickerTip* the();
+
+ /**
+ * Enables / disables tipping. For every call to turn it off/on, a
+ * corresponding call to turn it on/off must be made at some point.
+ * @param tip when true enables tipping, when false disables tipping
+ */
static void enableTipping(bool tip);
+
+ /**
+ * Returns whether or not tipping is currently enabled
+ */
static bool tippingEnabled();
+ /**
+ * The event filter installed by Clients on themselves to be tracked
+ * by the mouse over tip effect.
+ */
bool eventFilter(QObject *o, QEvent *e);
protected:
@@ -77,14 +107,37 @@
void paintEvent(QPaintEvent * e);
void mousePressEvent(QMouseEvent * e);
+ /**
+ * Creates and installs a solid mask with rounded corners
+ */
void plainMask();
+
+ /**
+ * Creates and installs a progressively fading in mask with rounded corners
+ */
void dissolveMask();
void displayInternal();
void hide();
+ /**
+ * Sets the widgets currently being tipped for
+ * @param w the widget that is the subject of the tipping
+ */
void tipFor(const QWidget* w);
+
+ /**
+ * If the widget passed in is currening being tipped for, then the tipping
+ * is stopped
+ * @param w the widget to cease tipping for
+ */
void untipFor(const QWidget* w);
+
+ /**
+ * Checks if the passed in widget is the current subject of the mouse
+ * mouse over tip.
+ * @param w the widget to check for
+ */
bool isTippingFor(const QWidget* w) const;
protected slots:
--- trunk/KDE/kdebase/kicker/libkicker/panelbutton.cpp #442268:442269
@@ -731,7 +731,7 @@
return false;
}
-void PanelButton::updateKickerTip(KickerTip::Data& data)
+void PanelButton::updateTipData(KickerTip::Data& data)
{
data.message = title();
data.subtext = toolTip();
--- trunk/KDE/kdebase/kicker/libkicker/panelbutton.h #442268:442269
@@ -186,7 +186,7 @@
* Update the contents of the button's KickerTip
* @param data new KickerTip data
*/
- void updateKickerTip(KickerTip::Data& data);
+ void updateTipData(KickerTip::Data& data);
signals:
/**
--- trunk/KDE/kdebase/kicker/taskbar/taskcontainer.cpp #442268:442269
@@ -168,7 +168,7 @@
checkAttention(task);
}
- KickerTip::Client::updateKickerTip();
+ KickerTip::Client::updateTip();
update();
}
@@ -309,7 +309,7 @@
updateFilteredTaskList();
checkAttention(task);
- KickerTip::Client::updateKickerTip();
+ KickerTip::Client::updateTip();
update();
connect(task, SIGNAL(changed()), SLOT(taskChanged()));
@@ -343,7 +343,7 @@
}
checkAttention();
- KickerTip::Client::updateKickerTip();
+ KickerTip::Client::updateTip();
update();
}
@@ -1479,7 +1479,7 @@
update();
}
-void TaskContainer::updateKickerTip(KickerTip::Data& data)
+void TaskContainer::updateTipData(KickerTip::Data& data)
{
if (m_startup)
{
--- trunk/KDE/kdebase/kicker/taskbar/taskcontainer.h #442268:442269
@@ -90,7 +90,7 @@
bool activateNextTask( bool forward, bool& forcenext );
- void updateKickerTip(KickerTip::Data&);
+ void updateTipData(KickerTip::Data&);
signals:
void showMe(TaskContainer*);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic