add a tooltip
svn path=/trunk/KDE/kdelibs/; revision=1032393
This commit is contained in:
parent
3037b9823d
commit
0d3fdb718a
@ -36,6 +36,8 @@
|
|||||||
|
|
||||||
#include <plasma/applet.h>
|
#include <plasma/applet.h>
|
||||||
#include <plasma/containment.h>
|
#include <plasma/containment.h>
|
||||||
|
#include <plasma/tooltipcontent.h>
|
||||||
|
#include <plasma/tooltipmanager.h>
|
||||||
#include <plasma/widgets/iconwidget.h>
|
#include <plasma/widgets/iconwidget.h>
|
||||||
|
|
||||||
namespace Plasma
|
namespace Plasma
|
||||||
@ -222,6 +224,7 @@ DesktopToolBox::DesktopToolBox(Containment *parent)
|
|||||||
connect(this, SIGNAL(toggled()), this, SLOT(toggle()));
|
connect(this, SIGNAL(toggled()), this, SLOT(toggle()));
|
||||||
connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()),
|
connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()),
|
||||||
this, SLOT(updateTheming()));
|
this, SLOT(updateTheming()));
|
||||||
|
ToolTipManager::self()->registerWidget(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
DesktopToolBox::~DesktopToolBox()
|
DesktopToolBox::~DesktopToolBox()
|
||||||
@ -269,6 +272,25 @@ QSize DesktopToolBox::fullHeight() const
|
|||||||
return QSize(size() + left, size() + top + bottom + extraSpace);
|
return QSize(size() + left, size() + top + bottom + extraSpace);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DesktopToolBox::toolTipAboutToShow()
|
||||||
|
{
|
||||||
|
if (isToolbar() || showing()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ToolTipContent c(i18n("Tool Box"),
|
||||||
|
i18n("Click to access configuration options and controls or to add more widget to the %1.",
|
||||||
|
containment()->name()),
|
||||||
|
KIcon("plasma"));
|
||||||
|
c.setAutohide(false);
|
||||||
|
ToolTipManager::self()->setContent(this, c);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DesktopToolBox::toolTipHidden()
|
||||||
|
{
|
||||||
|
ToolTipManager::self()->clearContent(this);
|
||||||
|
}
|
||||||
|
|
||||||
QRectF DesktopToolBox::boundingRect() const
|
QRectF DesktopToolBox::boundingRect() const
|
||||||
{
|
{
|
||||||
int extraSpace = size();
|
int extraSpace = size();
|
||||||
|
@ -55,6 +55,10 @@ public:
|
|||||||
QSize fullWidth() const;
|
QSize fullWidth() const;
|
||||||
QSize fullHeight() const;
|
QSize fullHeight() const;
|
||||||
|
|
||||||
|
public Q_SLOTS:
|
||||||
|
void toolTipAboutToShow();
|
||||||
|
void toolTipHidden();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
|
||||||
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
|
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user