From 97cf7b6dcde096739175aeb44a02e6685166dde9 Mon Sep 17 00:00:00 2001 From: miruka Date: Thu, 5 Dec 2019 10:51:57 -0400 Subject: [PATCH] EventImage: respect uiScale --- src/qml/Chat/Timeline/EventImage.qml | 25 ++++++++++++++++--------- src/themes/Default.qpl | 15 ++++++++------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/src/qml/Chat/Timeline/EventImage.qml b/src/qml/Chat/Timeline/EventImage.qml index 53cd4131..d8768def 100644 --- a/src/qml/Chat/Timeline/EventImage.qml +++ b/src/qml/Chat/Timeline/EventImage.qml @@ -31,18 +31,25 @@ HMxcImage { theme.chat.message.thumbnailMinSize.height, // Real size - loader.singleMediaInfo.thumbnail_width || - loader.singleMediaInfo.media_width || - implicitWidth || - 800, + ( + loader.singleMediaInfo.thumbnail_width || + loader.singleMediaInfo.media_width || + implicitWidth || + 800 + ) * theme.uiScale, - loader.singleMediaInfo.thumbnail_height || - loader.singleMediaInfo.media_height || - implicitHeight || - 600, + ( + loader.singleMediaInfo.thumbnail_height || + loader.singleMediaInfo.media_height || + implicitHeight || + 600 + ) * theme.uiScale, // Maximum display size - Math.min(eventList.height * maxHeight, eventContent.messageBodyWidth), + Math.min( + eventList.height * maxHeight, + eventContent.messageBodyWidth * Math.min(1, theme.uiScale), + ), eventList.height * maxHeight, ) diff --git a/src/themes/Default.qpl b/src/themes/Default.qpl index a900ce3a..8ce78096 100644 --- a/src/themes/Default.qpl +++ b/src/themes/Default.qpl @@ -182,10 +182,11 @@ controls: int borderWidth: 2 progressBar: - int height: Math.max(2, spacing / 2) - color background: colors.inputBackground - color foreground: colors.accentBackground - color errorForeground: colors.negativeBackground + int height: Math.max(2, spacing / 2) + color background: colors.inputBackground + color foreground: colors.accentBackground + color pausedForeground: colors.middleBackground + color errorForeground: colors.negativeBackground circleProgressBar: int thickness: Math.max(2, spacing / 2) @@ -362,15 +363,15 @@ chat: '\n' // Prefered minimum width of file messages - int fileMinWidth: 256 + int fileMinWidth: 256 * uiScale // Don't scale down thumbnails below this size in pixels, if // the becomes too small to show it at normal size. - size thumbnailMinSize: Qt.size(192, 192) + size thumbnailMinSize: Qt.size(192 * uiScale, 192 * uiScale) // How much of the chat height thumbnails can take at most, // by default 0.3 for 30%. - real thumbnailMaxHeightRatio: 0.3 + real thumbnailMaxHeightRatio: 0.3 * Math.min(1, uiScale) daybreak: color background: colors.strongBackground