Increase margins a bit, wm hints

This commit is contained in:
Sebastian Kügler 2013-04-04 02:02:10 +02:00
parent 7e6d750f2a
commit c739f3ae58
3 changed files with 14 additions and 12 deletions

View File

@ -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
}
}

View File

@ -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<QQuickItem *>(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"

View File

@ -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."
}
}