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 { mainItem: PlasmaCore.FrameSvgItem {
id: tooltipSvg id: tooltipSvg
imagePath: "widgets/tooltip" imagePath: "widgets/tooltip"
width: childrenRect.width + margins.left + margins.right width: childrenRect.width + margins.left + margins.right + 2*_s
height: childrenRect.height + margins.top + margins.bottom height: childrenRect.height + margins.top + margins.bottom + 2*_s
onWidthChanged: print("XXXX ====================================== svgframe width: " + width) onWidthChanged: print("XXXX ====================================== svgframe width: " + width)
onChildrenRectChanged: print("XXXX childrenRect chagned" + childrenRect.width + " " + childrenRect.height) onChildrenRectChanged: print("XXXX childrenRect chagned" + childrenRect.width + " " + childrenRect.height)
@ -96,7 +96,8 @@ MouseArea {
height: childrenRect.height height: childrenRect.height
anchors { anchors {
topMargin: parent.anchors.margins.top topMargin: parent.anchors.margins.top
leftMargin: parent.anchors.margins.left leftMargin: parent.anchors.margins.left + _s
rightMargin: _s
//fill: parent //fill: parent
} }
@ -119,7 +120,7 @@ MouseArea {
anchors { anchors {
left: tooltipIcon.right left: tooltipIcon.right
leftMargin: _s leftMargin: _s
//right: parent.right topMargin: _s
top: parent.top top: parent.top
} }
} }
@ -130,7 +131,7 @@ MouseArea {
left: tooltipIcon.right left: tooltipIcon.right
leftMargin: _s leftMargin: _s
topMargin: _s topMargin: _s
//right: parent.right bottomMargin: _s
top: tooltipMaintext.bottom top: tooltipMaintext.bottom
} }
} }

View File

@ -40,8 +40,9 @@ ToolTipWindow::ToolTipWindow(QWindow *parent)
setFormat(format); setFormat(format);
setClearBeforeRendering(true); setClearBeforeRendering(true);
setColor(QColor(Qt::transparent)); setColor(QColor(Qt::transparent));
// setFlags(Qt::FramelessWindowHint); setFlags(Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint | Qt::ToolTip);
// tooltipDialog.setAttribute(Qt.WA_X11NetWmWindowTypeToolTip, true) //setAttribute
//setAttribute(Qt::WA_X11NetWmWindowTypeToolTip, true)
// tooltipDialog.windowFlags = Qt.Window|Qt.WindowStaysOnTopHint|Qt.X11BypassWindowManagerHint // tooltipDialog.windowFlags = Qt.Window|Qt.WindowStaysOnTopHint|Qt.X11BypassWindowManagerHint
//m_flags = flags(); //m_flags = flags();
@ -87,7 +88,7 @@ void ToolTipWindow::syncGeometry()
qDebug() << " XXX synching geometry"; qDebug() << " XXX synching geometry";
qDebug() << "XXXX mainitem : " << mainItem()->width() << mainItem()->height(); qDebug() << "XXXX mainitem : " << mainItem()->width() << mainItem()->height();
resize(mainItem()->width(), mainItem()->height()); resize(mainItem()->width(), mainItem()->height());
setPosition(100, 100); setPosition(popupPosition());
} }
QString ToolTipWindow::mainText() const QString ToolTipWindow::mainText() const
@ -258,12 +259,12 @@ QPoint ToolTipWindow::popupPosition(QQuickItem *item, Qt::AlignmentFlag alignmen
// FIXME :: Item // FIXME :: Item
QQuickItem *parentItem = qobject_cast<QQuickItem *>(parent()); QQuickItem *parentItem = qobject_cast<QQuickItem *>(parent());
if (parentItem && parentItem->window()) { 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); qDebug() << parentItem->window()->geometry().center() - QPoint(width()/2, height()/2);
return parentItem->window()->geometry().center() - QPoint(width()/2, height()/2); return parentItem->window()->geometry().center() - QPoint(width()/2, height()/2);
} else { } else {
qDebug() << "No QQuickItem as parent found"; qDebug() << "XXX No QQuickItem as parent found";
return QPoint(); return QPoint(100, 100);
} }
} }
//#include "tooltip.moc" //#include "tooltip.moc"

View File

@ -98,7 +98,7 @@ PlasmaComponents.Page {
PlasmaCore.ToolTip { PlasmaCore.ToolTip {
anchors.fill: parent anchors.fill: parent
mainText: "Fish sighted" mainText: "Fish sighted"
subText: "A mean-looking grouper swam by" subText: "A mean-looking grouper swam by."
} }
} }