tooltip now uses a dialog

A bit crude, and only half-working, but shows up
This commit is contained in:
Sebastian Kügler 2013-04-05 01:10:53 +02:00
parent feda4f5013
commit 8eab0f20f2
2 changed files with 14 additions and 5 deletions

View File

@ -40,8 +40,8 @@ import org.kde.plasma.extras 2.0 as PlasmaExtras
MouseArea {
id: tooltip
property alias mainText: tooltipWindow.mainText // string
property alias subText: tooltipWindow.subText // string
property alias mainText: tooltipMaintext.text // string
property alias subText: tooltipSubtext.text // string
property alias iconSource: tooltipIcon.source // icon name
property alias image: tooltipImage.source // string / url to the image
property Item target: parent
@ -71,13 +71,13 @@ MouseArea {
}
}
PlasmaCore.ToolTipWindow {
PlasmaCore.ToolTipProxy {
id: tooltipWindow
visualParent: tooltip.target
mainItem: PlasmaCore.FrameSvgItem {
id: tooltipSvg
imagePath: "widgets/tooltip"
//imagePath: "widgets/tooltip"
width: childrenRect.width + margins.left + margins.right + 2*_s
height: childrenRect.height + margins.top + margins.bottom + 2*_s

View File

@ -20,6 +20,7 @@
***************************************************************************/
#include "tooltip.h"
#include "tooltipdialog.h"
#include <QQuickItem>
#include <QDebug>
@ -114,11 +115,19 @@ bool ToolTip::isVisible() const
void ToolTip::setVisible(const bool visible)
{
ToolTipDialog *dlg = ToolTipDialog::instance();
qDebug() << visible;
if (visible) {
//setPosition(popupPosition());
qDebug() << " showing tooltip: " << ToolTipDialog::instance();
dlg->setMainItem(mainItem());
dlg->setVisualParent(m_visualParent.data());
dlg->setPosition(dlg->popupPosition(visualParent()));
dlg->setVisible(true);
// syncGeometry();
// raise();
} else {
dlg->setVisible(false);
}
//QQuickWindow::setVisible(visible);
}