From c739f3ae589c59d1ac9489c8b035eb60294cd4e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCgler?= Date: Thu, 4 Apr 2013 02:02:10 +0200 Subject: [PATCH] Increase margins a bit, wm hints --- src/declarativeimports/core/ToolTip.qml | 11 ++++++----- src/declarativeimports/core/tooltip.cpp | 13 +++++++------ .../testcomponentsapplet/contents/ui/IconsPage.qml | 2 +- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/declarativeimports/core/ToolTip.qml b/src/declarativeimports/core/ToolTip.qml index 6dc5b84cb..2fde8f6e2 100644 --- a/src/declarativeimports/core/ToolTip.qml +++ b/src/declarativeimports/core/ToolTip.qml @@ -82,8 +82,8 @@ MouseArea { mainItem: PlasmaCore.FrameSvgItem { id: tooltipSvg imagePath: "widgets/tooltip" - width: childrenRect.width + margins.left + margins.right - height: childrenRect.height + margins.top + margins.bottom + width: childrenRect.width + margins.left + margins.right + 2*_s + height: childrenRect.height + margins.top + margins.bottom + 2*_s onWidthChanged: print("XXXX ====================================== svgframe width: " + width) onChildrenRectChanged: print("XXXX childrenRect chagned" + childrenRect.width + " " + childrenRect.height) @@ -96,7 +96,8 @@ MouseArea { height: childrenRect.height anchors { topMargin: parent.anchors.margins.top - leftMargin: parent.anchors.margins.left + leftMargin: parent.anchors.margins.left + _s + rightMargin: _s //fill: parent } @@ -119,7 +120,7 @@ MouseArea { anchors { left: tooltipIcon.right leftMargin: _s - //right: parent.right + topMargin: _s top: parent.top } } @@ -130,7 +131,7 @@ MouseArea { left: tooltipIcon.right leftMargin: _s topMargin: _s - //right: parent.right + bottomMargin: _s top: tooltipMaintext.bottom } } diff --git a/src/declarativeimports/core/tooltip.cpp b/src/declarativeimports/core/tooltip.cpp index 76896f06e..51a05080a 100644 --- a/src/declarativeimports/core/tooltip.cpp +++ b/src/declarativeimports/core/tooltip.cpp @@ -40,8 +40,9 @@ ToolTipWindow::ToolTipWindow(QWindow *parent) setFormat(format); setClearBeforeRendering(true); setColor(QColor(Qt::transparent)); -// setFlags(Qt::FramelessWindowHint); -// tooltipDialog.setAttribute(Qt.WA_X11NetWmWindowTypeToolTip, true) + setFlags(Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint | Qt::ToolTip); + //setAttribute + //setAttribute(Qt::WA_X11NetWmWindowTypeToolTip, true) // tooltipDialog.windowFlags = Qt.Window|Qt.WindowStaysOnTopHint|Qt.X11BypassWindowManagerHint //m_flags = flags(); @@ -87,7 +88,7 @@ void ToolTipWindow::syncGeometry() qDebug() << " XXX synching geometry"; qDebug() << "XXXX mainitem : " << mainItem()->width() << mainItem()->height(); resize(mainItem()->width(), mainItem()->height()); - setPosition(100, 100); + setPosition(popupPosition()); } QString ToolTipWindow::mainText() const @@ -258,12 +259,12 @@ QPoint ToolTipWindow::popupPosition(QQuickItem *item, Qt::AlignmentFlag alignmen // FIXME :: Item QQuickItem *parentItem = qobject_cast(parent()); if (parentItem && parentItem->window()) { - qDebug() << "NO visual parent ... Centering at " << (parentItem->window()->geometry().center() - QPoint(width()/2, height()/2)); + qDebug() << "XXX NO visual parent ... Centering at " << (parentItem->window()->geometry().center() - QPoint(width()/2, height()/2)); qDebug() << parentItem->window()->geometry().center() - QPoint(width()/2, height()/2); return parentItem->window()->geometry().center() - QPoint(width()/2, height()/2); } else { - qDebug() << "No QQuickItem as parent found"; - return QPoint(); + qDebug() << "XXX No QQuickItem as parent found"; + return QPoint(100, 100); } } //#include "tooltip.moc" diff --git a/src/shell/applets/testcomponentsapplet/contents/ui/IconsPage.qml b/src/shell/applets/testcomponentsapplet/contents/ui/IconsPage.qml index 13d119d56..0d10d96d4 100644 --- a/src/shell/applets/testcomponentsapplet/contents/ui/IconsPage.qml +++ b/src/shell/applets/testcomponentsapplet/contents/ui/IconsPage.qml @@ -98,7 +98,7 @@ PlasmaComponents.Page { PlasmaCore.ToolTip { anchors.fill: parent mainText: "Fish sighted" - subText: "A mean-looking grouper swam by" + subText: "A mean-looking grouper swam by." } }