From fcdd960779a21d45be122f5fc41fb3a856b104d9 Mon Sep 17 00:00:00 2001 From: miruka Date: Thu, 12 Sep 2019 19:54:31 -0400 Subject: [PATCH] Fix avatar tooltips --- TODO.md | 1 - src/qml/Base/HAvatar.qml | 17 +++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/TODO.md b/TODO.md index df7bc47c..d4ec2d0f 100644 --- a/TODO.md +++ b/TODO.md @@ -13,7 +13,6 @@ - When qml syntax highlighting supports ES6 string interpolation, use that - Fixes - - Image tooltips - Time on their own lines - When selecting text and scrolling up, selection stops working after a while - Ensure all the text that should be copied is copied diff --git a/src/qml/Base/HAvatar.qml b/src/qml/Base/HAvatar.qml index db65dc10..10d20da2 100644 --- a/src/qml/Base/HAvatar.qml +++ b/src/qml/Base/HAvatar.qml @@ -57,22 +57,23 @@ Rectangle { HToolTip { id: avatarToolTip visible: toolTipImageUrl && hoverHandler.hovered - width: Math.min( + delay: 1000 + + readonly property int dimension: Math.min( mainUI.width / 1.25, mainUI.height / 1.25, theme.controls.avatar.hoveredSize + background.border.width * 2 ) - height: width - delay: 1000 - HImage { + contentItem: HImage { id: avatarToolTipImage - sourceSize.width: parent.width - sourceSize.height: parent.height - width: sourceSize.width - height: sourceSize.width fillMode: Image.PreserveAspectCrop source: Qt.resolvedUrl(toolTipImageUrl) + + sourceSize.width: avatarToolTip.dimension + sourceSize.height: avatarToolTip.dimension + width: avatarToolTip.dimension + height: avatarToolTip.dimension } } }