Make thumbnail min/max size configurable via theme
This commit is contained in:
parent
deedc8c7aa
commit
dbdb7b9bb0
|
@ -24,10 +24,13 @@ HMxcImage {
|
||||||
readonly property bool isEncrypted: ! Utils.isEmptyObject(cryptDict)
|
readonly property bool isEncrypted: ! Utils.isEmptyObject(cryptDict)
|
||||||
readonly property string openUrl: isEncrypted ? cachedPath : image.httpUrl
|
readonly property string openUrl: isEncrypted ? cachedPath : image.httpUrl
|
||||||
|
|
||||||
|
readonly property real maxHeight:
|
||||||
|
theme.chat.message.thumbnailMaxHeightRatio
|
||||||
|
|
||||||
readonly property size fitSize: Utils.fitSize(
|
readonly property size fitSize: Utils.fitSize(
|
||||||
// Minimum display size
|
// Minimum display size
|
||||||
192,
|
theme.chat.message.thumbnailMinSize.width,
|
||||||
192,
|
theme.chat.message.thumbnailMinSize.height,
|
||||||
|
|
||||||
// Real size
|
// Real size
|
||||||
loader.singleMediaInfo.thumbnail_width ||
|
loader.singleMediaInfo.thumbnail_width ||
|
||||||
|
@ -41,8 +44,8 @@ HMxcImage {
|
||||||
600,
|
600,
|
||||||
|
|
||||||
// Maximum display size
|
// Maximum display size
|
||||||
Math.min(eventList.height / 3, eventContent.messageBodyWidth),
|
Math.min(eventList.height * maxHeight, eventContent.messageBodyWidth),
|
||||||
eventList.height / 3,
|
eventList.height * maxHeight,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -352,11 +352,16 @@ chat:
|
||||||
string styleInclude:
|
string styleInclude:
|
||||||
'<style type"text/css">\n' + styleSheet + '\n</style>\n'
|
'<style type"text/css">\n' + styleSheet + '\n</style>\n'
|
||||||
|
|
||||||
// TODO rename
|
// Prefered minimum width of file messages
|
||||||
int fileMinWidth: 256
|
int fileMinWidth: 256
|
||||||
int thumbnailWidth: 256
|
|
||||||
int videoWidth: 640
|
// Don't scale down thumbnails below this size in pixels, if
|
||||||
int audioWidth: 320
|
// the becomes too small to show it at normal size.
|
||||||
|
size thumbnailMinSize: Qt.size(192, 192)
|
||||||
|
|
||||||
|
// How much of the chat height thumbnails can take at most,
|
||||||
|
// by default 0.3 for 30%.
|
||||||
|
real thumbnailMaxHeightRatio: 0.3
|
||||||
|
|
||||||
daybreak:
|
daybreak:
|
||||||
color background: colors.strongBackground
|
color background: colors.strongBackground
|
||||||
|
|
Loading…
Reference in New Issue
Block a user