use hints to ensure proper size

This commit is contained in:
Marco Martin 2014-03-06 14:37:19 +01:00
parent 83b0c8cc3c
commit 3d5f105c80
2 changed files with 9 additions and 2 deletions

View File

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

View File

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