EventImage: respect uiScale

This commit is contained in:
miruka 2019-12-05 10:51:57 -04:00
parent a555ad0e19
commit 97cf7b6dcd
2 changed files with 24 additions and 16 deletions

View File

@ -31,18 +31,25 @@ HMxcImage {
theme.chat.message.thumbnailMinSize.height, theme.chat.message.thumbnailMinSize.height,
// Real size // Real size
loader.singleMediaInfo.thumbnail_width || (
loader.singleMediaInfo.media_width || loader.singleMediaInfo.thumbnail_width ||
implicitWidth || loader.singleMediaInfo.media_width ||
800, implicitWidth ||
800
) * theme.uiScale,
loader.singleMediaInfo.thumbnail_height || (
loader.singleMediaInfo.media_height || loader.singleMediaInfo.thumbnail_height ||
implicitHeight || loader.singleMediaInfo.media_height ||
600, implicitHeight ||
600
) * theme.uiScale,
// Maximum display size // 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, eventList.height * maxHeight,
) )

View File

@ -182,10 +182,11 @@ controls:
int borderWidth: 2 int borderWidth: 2
progressBar: progressBar:
int height: Math.max(2, spacing / 2) int height: Math.max(2, spacing / 2)
color background: colors.inputBackground color background: colors.inputBackground
color foreground: colors.accentBackground color foreground: colors.accentBackground
color errorForeground: colors.negativeBackground color pausedForeground: colors.middleBackground
color errorForeground: colors.negativeBackground
circleProgressBar: circleProgressBar:
int thickness: Math.max(2, spacing / 2) int thickness: Math.max(2, spacing / 2)
@ -362,15 +363,15 @@ chat:
'<style type"text/css">\n' + styleSheet + '\n</style>\n' '<style type"text/css">\n' + styleSheet + '\n</style>\n'
// Prefered minimum width of file messages // Prefered minimum width of file messages
int fileMinWidth: 256 int fileMinWidth: 256 * uiScale
// Don't scale down thumbnails below this size in pixels, if // Don't scale down thumbnails below this size in pixels, if
// the becomes too small to show it at normal size. // 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, // How much of the chat height thumbnails can take at most,
// by default 0.3 for 30%. // by default 0.3 for 30%.
real thumbnailMaxHeightRatio: 0.3 real thumbnailMaxHeightRatio: 0.3 * Math.min(1, uiScale)
daybreak: daybreak:
color background: colors.strongBackground color background: colors.strongBackground