From 16f4e17e8fb95cd6fba2c5fc1f22f585bb0eb7b7 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Sat, 16 Nov 2024 11:00:40 -0500 Subject: [PATCH] Improve how stickers appear in the emoji picker First, the fill mode for the sticker images shouldn't stretch them. Also make sure there is enough padding in the category so the image doesn't appear larger than the button. Finally, set the source size for the images so Qt can smooth them out better. --- src/chatbar/EmojiDelegate.qml | 3 +++ src/chatbar/EmojiPicker.qml | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/src/chatbar/EmojiDelegate.qml b/src/chatbar/EmojiDelegate.qml index 3ac3b68c0..a38c1b4a2 100644 --- a/src/chatbar/EmojiDelegate.qml +++ b/src/chatbar/EmojiDelegate.qml @@ -43,6 +43,9 @@ QQC2.ItemDelegate { anchors.fill: parent visible: root.emoji.startsWith("mxc") || root.isImage source: visible ? root.emoji : "" + fillMode: Image.PreserveAspectFit + sourceSize.width: width + sourceSize.height: height } } diff --git a/src/chatbar/EmojiPicker.qml b/src/chatbar/EmojiPicker.qml index 1a169740e..fdd437c60 100644 --- a/src/chatbar/EmojiPicker.qml +++ b/src/chatbar/EmojiPicker.qml @@ -201,8 +201,13 @@ ColumnLayout { width: root.categoryIconSize height: width checked: stickerModel.packIndex === model.index + padding: Kirigami.Units.largeSpacing + contentItem: Image { source: model.avatarUrl + fillMode: Image.PreserveAspectFit + sourceSize.width: width + sourceSize.height: height } QQC2.ToolTip.text: model.name QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay