From 3d5f105c80d12b4b8db66f97eb21399196a5ce5a Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 6 Mar 2014 14:37:19 +0100 Subject: [PATCH] use hints to ensure proper size --- src/declarativeimports/core/private/DefaultToolTip.qml | 5 +++++ src/declarativeimports/core/tooltipdialog.cpp | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/declarativeimports/core/private/DefaultToolTip.qml b/src/declarativeimports/core/private/DefaultToolTip.qml index 4d1aa6c3f..c7b5335a7 100644 --- a/src/declarativeimports/core/private/DefaultToolTip.qml +++ b/src/declarativeimports/core/private/DefaultToolTip.qml @@ -18,6 +18,7 @@ */ import QtQuick 2.0 +import QtQuick.Layouts 1.1 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.extras 2.0 as PlasmaExtras @@ -33,6 +34,10 @@ Row { property int preferredTextWidth: theme.mSize(theme.defaultFont).width * 40 property int _s: units.largeSpacing / 2 + Layout.minimumWidth: implicitWidth + _s + Layout.minimumHeight: implicitHeight + _s * 2 + Layout.maximumWidth: implicitWidth + _s + Layout.maximumHeight: implicitHeight + _s * 2 width: implicitWidth + _s height: implicitHeight + _s * 2 diff --git a/src/declarativeimports/core/tooltipdialog.cpp b/src/declarativeimports/core/tooltipdialog.cpp index 5a6b908a5..9f74a8cde 100644 --- a/src/declarativeimports/core/tooltipdialog.cpp +++ b/src/declarativeimports/core/tooltipdialog.cpp @@ -94,7 +94,6 @@ void ToolTipDialog::showEvent(QShowEvent *event) m_animation->stop(); DialogProxy::showEvent(event); - setFlags(Qt::ToolTip); } void ToolTipDialog::hideEvent(QHideEvent *event) @@ -119,7 +118,10 @@ bool ToolTipDialog::event(QEvent *e) } else if (e->type() == QEvent::Leave) { dismiss(); } - return DialogProxy::event(e); + + bool ret = DialogProxy::event(e); + setFlags(Qt::ToolTip | Qt::WindowDoesNotAcceptFocus | Qt::WindowStaysOnTopHint); + return ret; } void ToolTipDialog::adjustGeometry(const QRect &geom)