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.
This commit is contained in:
Joshua Goins
2024-11-16 11:00:40 -05:00
parent 0e9592a96c
commit 16f4e17e8f
2 changed files with 8 additions and 0 deletions

View File

@@ -43,6 +43,9 @@ QQC2.ItemDelegate {
anchors.fill: parent anchors.fill: parent
visible: root.emoji.startsWith("mxc") || root.isImage visible: root.emoji.startsWith("mxc") || root.isImage
source: visible ? root.emoji : "" source: visible ? root.emoji : ""
fillMode: Image.PreserveAspectFit
sourceSize.width: width
sourceSize.height: height
} }
} }

View File

@@ -201,8 +201,13 @@ ColumnLayout {
width: root.categoryIconSize width: root.categoryIconSize
height: width height: width
checked: stickerModel.packIndex === model.index checked: stickerModel.packIndex === model.index
padding: Kirigami.Units.largeSpacing
contentItem: Image { contentItem: Image {
source: model.avatarUrl source: model.avatarUrl
fillMode: Image.PreserveAspectFit
sourceSize.width: width
sourceSize.height: height
} }
QQC2.ToolTip.text: model.name QQC2.ToolTip.text: model.name
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay