mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-25 07:57:19 +00:00
move tooltip to proxydiwget
This commit is contained in:
parent
583046e195
commit
64fdc4bebe
@ -24,6 +24,8 @@
|
|||||||
#include <Plasma/Containment>
|
#include <Plasma/Containment>
|
||||||
#include <Plasma/Corona>
|
#include <Plasma/Corona>
|
||||||
#include <Plasma/Theme>
|
#include <Plasma/Theme>
|
||||||
|
#include <Plasma/ToolTipContent>
|
||||||
|
#include <Plasma/ToolTipManager>
|
||||||
#include <QBuffer>
|
#include <QBuffer>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
@ -115,6 +117,7 @@ void DesktopPanel::init()
|
|||||||
timer->setSingleShot(false);
|
timer->setSingleShot(false);
|
||||||
timer->setInterval(2000);
|
timer->setInterval(2000);
|
||||||
connect(timer, SIGNAL(timeout()), this, SLOT(updateTooltip()));
|
connect(timer, SIGNAL(timeout()), this, SLOT(updateTooltip()));
|
||||||
|
connect(this, SIGNAL(releaseVisualFocus()), this, SLOT(paintTooltip()));
|
||||||
timer->start();
|
timer->start();
|
||||||
connect(this, SIGNAL(activate()), this, SLOT(changePanelsState()));
|
connect(this, SIGNAL(activate()), this, SLOT(changePanelsState()));
|
||||||
connect(KWindowSystem::self(), SIGNAL(currentDesktopChanged(int)), this, SLOT(updateText(int)));
|
connect(KWindowSystem::self(), SIGNAL(currentDesktopChanged(int)), this, SLOT(updateText(int)));
|
||||||
@ -278,6 +281,13 @@ void DesktopPanel::changePanelsState()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DesktopPanel::paintTooltip()
|
||||||
|
{
|
||||||
|
if (debug) qDebug() << PDEBUG;
|
||||||
|
qDebug() << PDEBUG;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void DesktopPanel::setCurrentDesktop(const int number)
|
void DesktopPanel::setCurrentDesktop(const int number)
|
||||||
{
|
{
|
||||||
if (debug) qDebug() << PDEBUG;
|
if (debug) qDebug() << PDEBUG;
|
||||||
@ -325,7 +335,7 @@ void DesktopPanel::updateTooltip()
|
|||||||
if (debug) qDebug() << PDEBUG;
|
if (debug) qDebug() << PDEBUG;
|
||||||
if (configuration[QString("tooltip")].toInt() != 2) return;
|
if (configuration[QString("tooltip")].toInt() != 2) return;
|
||||||
|
|
||||||
for (int i=0; i<labels.count(); i++) {
|
for (int i=0; i<proxyWidgets.count(); i++) {
|
||||||
QGraphicsScene *toolTipScene = new QGraphicsScene();
|
QGraphicsScene *toolTipScene = new QGraphicsScene();
|
||||||
toolTipScene->setBackgroundBrush(QBrush(Qt::NoBrush));
|
toolTipScene->setBackgroundBrush(QBrush(Qt::NoBrush));
|
||||||
QGraphicsView *toolTipView = new QGraphicsView(toolTipScene);
|
QGraphicsView *toolTipView = new QGraphicsView(toolTipScene);
|
||||||
@ -356,7 +366,7 @@ void DesktopPanel::updateTooltip()
|
|||||||
QString url = QString("<html><style type=\"text/css\">body {margin: 0; padding: 0;}</style><body><img src=\"data:image/png;base64,") +
|
QString url = QString("<html><style type=\"text/css\">body {margin: 0; padding: 0;}</style><body><img src=\"data:image/png;base64,") +
|
||||||
byteArray.toBase64() +
|
byteArray.toBase64() +
|
||||||
QString("\"/></body></html>");
|
QString("\"/></body></html>");
|
||||||
labels[i]->setToolTip(url);
|
proxyWidgets[i]->setToolTip(url);
|
||||||
delete toolTipView;
|
delete toolTipView;
|
||||||
delete toolTipScene;
|
delete toolTipScene;
|
||||||
}
|
}
|
||||||
|
@ -83,6 +83,7 @@ public slots:
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void reinit();
|
void reinit();
|
||||||
|
void paintTooltip();
|
||||||
void setFontFormating();
|
void setFontFormating();
|
||||||
void setFormating();
|
void setFormating();
|
||||||
void updateText(const int active);
|
void updateText(const int active);
|
||||||
|
Loading…
Reference in New Issue
Block a user