diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-12-13 19:09:03 +0100 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-12-13 19:09:03 +0100 |
commit | a0699f52475f5a2fca9d261bb886f8680b5ecf5d (patch) | |
tree | afd0b820f4981859392d23f237055fff39a09afe | |
parent | Fix turnserver check not being started when restoring from cache (diff) | |
download | nheko-a0699f52475f5a2fca9d261bb886f8680b5ecf5d.tar.xz |
Multiply source size by scale factor
Might be unnecessary, but docs are unclear on that.
-rw-r--r-- | resources/qml/Avatar.qml | 5 | ||||
-rw-r--r-- | resources/qml/EncryptionIndicator.qml | 5 | ||||
-rw-r--r-- | resources/qml/TimelineRow.qml | 4 | ||||
-rw-r--r-- | resources/qml/TopBar.qml | 5 | ||||
-rw-r--r-- | resources/qml/delegates/ImageMessage.qml | 8 | ||||
-rw-r--r-- | resources/qml/dialogs/UserProfile.qml | 4 | ||||
-rw-r--r-- | resources/qml/emoji/EmojiPicker.qml | 5 |
7 files changed, 20 insertions, 16 deletions
diff --git a/resources/qml/Avatar.qml b/resources/qml/Avatar.qml index 58b22863..27d139d4 100644 --- a/resources/qml/Avatar.qml +++ b/resources/qml/Avatar.qml @@ -5,6 +5,7 @@ import "./ui" import QtQuick 2.6 import QtQuick.Controls 2.3 +import QtQuick.Window 2.15 import im.nheko 1.0 Rectangle { @@ -67,8 +68,8 @@ Rectangle { fillMode: avatar.crop ? Image.PreserveAspectCrop : Image.PreserveAspectFit mipmap: true smooth: true - sourceSize.width: avatar.width - sourceSize.height: avatar.height + sourceSize.width: avatar.width * Screen.devicePixelRatio + sourceSize.height: avatar.height * Screen.devicePixelRatio source: avatar.url ? (avatar.url + "?radius=" + (Settings.avatarCircles ? 100 : 25) + ((avatar.crop) ? "" : "&scale")) : "" MouseArea { diff --git a/resources/qml/EncryptionIndicator.qml b/resources/qml/EncryptionIndicator.qml index 0bd0dfa1..12b6e20a 100644 --- a/resources/qml/EncryptionIndicator.qml +++ b/resources/qml/EncryptionIndicator.qml @@ -4,6 +4,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.1 +import QtQuick.Window 2.15 import im.nheko 1.0 Image { @@ -30,8 +31,8 @@ Image { width: 16 height: 16 - sourceSize.height: height - sourceSize.width: width + sourceSize.height: height * Screen.devicePixelRatio + sourceSize.width: width * Screen.devicePixelRatio source: { if (encrypted) { switch (trust) { diff --git a/resources/qml/TimelineRow.qml b/resources/qml/TimelineRow.qml index b56fbe5b..5abc15de 100644 --- a/resources/qml/TimelineRow.qml +++ b/resources/qml/TimelineRow.qml @@ -167,8 +167,8 @@ Item { Layout.preferredWidth: 16 height: 16 width: 16 - sourceSize.width: 16 - sourceSize.height: 16 + sourceSize.width: 16 * Screen.devicePixelRatio + sourceSize.height: 16 * Screen.devicePixelRatio source: "image://colorimage/:/icons/icons/ui/edit.svg?" + ((eventId == chat.model.edit) ? Nheko.colors.highlight : Nheko.colors.buttonText) ToolTip.visible: editHovered.hovered ToolTip.text: qsTr("Edited") diff --git a/resources/qml/TopBar.qml b/resources/qml/TopBar.qml index b9d1f85f..8ddd0573 100644 --- a/resources/qml/TopBar.qml +++ b/resources/qml/TopBar.qml @@ -6,6 +6,7 @@ import Qt.labs.platform 1.1 as Platform import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Layouts 1.2 +import QtQuick.Window 2.15 import im.nheko 1.0 import "./delegates" @@ -133,8 +134,8 @@ Rectangle { Layout.rowSpan: 2 Layout.preferredHeight: Nheko.avatarSize - Nheko.paddingMedium Layout.preferredWidth: Nheko.avatarSize - Nheko.paddingMedium - sourceSize.height: Layout.preferredHeight - sourceSize.width: Layout.preferredWidth + sourceSize.height: Layout.preferredHeight * Screen.devicePixelRatio + sourceSize.width: Layout.preferredWidth * Screen.devicePixelRatio visible: isEncrypted encrypted: isEncrypted trust: trustlevel diff --git a/resources/qml/delegates/ImageMessage.qml b/resources/qml/delegates/ImageMessage.qml index 71c7bcc6..b8522a74 100644 --- a/resources/qml/delegates/ImageMessage.qml +++ b/resources/qml/delegates/ImageMessage.qml @@ -32,8 +32,8 @@ Item { source: blurhash ? ("image://blurhash/" + blurhash) : ("image://colorimage/:/icons/icons/ui/image-failed.svg?" + Nheko.colors.buttonText) asynchronous: true fillMode: Image.PreserveAspectFit - sourceSize.width: parent.width - sourceSize.height: parent.height + sourceSize.width: parent.width * Screen.devicePixelRatio + sourceSize.height: parent.height * Screen.devicePixelRatio } Image { @@ -47,8 +47,8 @@ Item { smooth: true mipmap: true - sourceSize.width: Math.min(Screen.desktopAvailableWidth, originalWidth || undefined) - sourceSize.height: Math.min(Screen.desktopAvailableHeight, originalWidth*proportionalHeight || undefined) + sourceSize.width: Math.min(Screen.desktopAvailableWidth, originalWidth || undefined) * Screen.devicePixelRatio + sourceSize.height: Math.min(Screen.desktopAvailableHeight, originalWidth*proportionalHeight || undefined) * Screen.devicePixelRatio } MxcAnimatedImage { diff --git a/resources/qml/dialogs/UserProfile.qml b/resources/qml/dialogs/UserProfile.qml index ba3f3a45..c1f0df3b 100644 --- a/resources/qml/dialogs/UserProfile.qml +++ b/resources/qml/dialogs/UserProfile.qml @@ -305,8 +305,8 @@ ApplicationWindow { Layout.preferredHeight: 16 Layout.preferredWidth: 16 visible: profile.isSelf && verificationStatus != VerificationStatus.NOT_APPLICABLE - sourceSize.height: 16 - sourceSize.width: 16 + sourceSize.height: 16 * Screen.devicePixelRatio + sourceSize.width: 16 * Screen.devicePixelRatio source: { switch (verificationStatus) { case VerificationStatus.VERIFIED: diff --git a/resources/qml/emoji/EmojiPicker.qml b/resources/qml/emoji/EmojiPicker.qml index 77dbf713..0b2bb4b2 100644 --- a/resources/qml/emoji/EmojiPicker.qml +++ b/resources/qml/emoji/EmojiPicker.qml @@ -7,6 +7,7 @@ import QtGraphicalEffects 1.0 import QtQuick 2.9 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.3 +import QtQuick.Window 2.15 import im.nheko 1.0 import im.nheko.EmojiModel 1.0 @@ -287,8 +288,8 @@ Menu { horizontalAlignment: Image.AlignHCenter verticalAlignment: Image.AlignVCenter fillMode: Image.Pad - sourceSize.width: 32 - sourceSize.height: 32 + sourceSize.width: 32 * Screen.devicePixelRatio + sourceSize.height: 32 * Screen.devicePixelRatio source: "image://colorimage/" + model.image + "?" + (hovered ? Nheko.colors.highlight : Nheko.colors.buttonText) } |