Prevent avatar tooltip from going out of bound

This commit is contained in:
miruka 2019-07-09 23:42:03 -04:00
parent eeca8b639d
commit 7e4cee31c7
2 changed files with 12 additions and 2 deletions

View File

@ -55,12 +55,17 @@ Rectangle {
} }
HToolTip { HToolTip {
id: avatarToolTip
visible: imageMouseArea.containsMouse visible: imageMouseArea.containsMouse
width: 128
height: 128
HImage { HImage {
id: avatarToolTipImage id: avatarToolTipImage
sourceSize.width: 128 sourceSize.width: avatarToolTip.width
sourceSize.height: 128 sourceSize.height: avatarToolTip.height
width: sourceSize.width
height: sourceSize.height
} }
} }
} }

View File

@ -2,7 +2,12 @@ import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
ToolTip { ToolTip {
// Be sure to have a width and height set, to prevent the tooltip from
// going out of the window's boundaries
id: toolTip
delay: Qt.styleHints.mousePressAndHoldInterval delay: Qt.styleHints.mousePressAndHoldInterval
padding: 0
enter: Transition { enter: Transition {
HNumberAnimation { property: "opacity"; from: 0.0; to: 1.0 } HNumberAnimation { property: "opacity"; from: 0.0; to: 1.0 }