Multiply source size by scale factor

Might be unnecessary, but docs are unclear on that.
This commit is contained in:
Nicolas Werner 2021-12-13 19:09:03 +01:00
parent 9b9d4bec70
commit a0699f5247
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
7 changed files with 20 additions and 16 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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