From a9c79b03595d7c8f515aa014cad0471dec7a6b11 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Tue, 10 May 2022 15:17:22 -0400 Subject: [PATCH] fix(StatusBaseInput): adjust emoji size and position in base input (#660) --- src/StatusQ/Controls/StatusBaseInput.qml | 5 +++-- src/StatusQ/Core/Utils/Emoji.qml | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/StatusQ/Controls/StatusBaseInput.qml b/src/StatusQ/Controls/StatusBaseInput.qml index 77976d54..62ab4830 100644 --- a/src/StatusQ/Controls/StatusBaseInput.qml +++ b/src/StatusQ/Controls/StatusBaseInput.qml @@ -313,6 +313,7 @@ Item { root.editClicked() } RowLayout { + spacing: 10 anchors { fill: parent leftMargin: root.leftPadding @@ -478,8 +479,8 @@ Item { StatusSmartIdenticon { id: identicon - icon.width: !root.icon.emoji ? 20 : 30 - icon.height: !root.icon.emoji ? 20 : 30 + icon.width: !root.icon.emoji ? 20 : 24 + icon.height: !root.icon.emoji ? 20 : 24 icon.background: root.icon.background icon.color: root.icon.color icon.letterSize: root.icon.letterSize diff --git a/src/StatusQ/Core/Utils/Emoji.qml b/src/StatusQ/Core/Utils/Emoji.qml index 2dc3e457..bd5dca98 100644 --- a/src/StatusQ/Core/Utils/Emoji.qml +++ b/src/StatusQ/Core/Utils/Emoji.qml @@ -98,7 +98,7 @@ QtObject { return undefined } - function getRandomEmoji() { + function getRandomEmoji(size) { var randomEmoji = EmojiJSON.emoji_json[Math.floor(Math.random() * EmojiJSON.emoji_json.length)] const extenstionIndex = randomEmoji.unicode.lastIndexOf('.'); @@ -115,6 +115,7 @@ QtObject { }) const encodedIcon = String.fromCodePoint(...codePointParts); - return Emoji.parse(encodedIcon) + ' ' + // Adding a space because otherwise, some emojis would fuse since emoji is just a string + return Emoji.parse(encodedIcon, size || undefined) + ' ' } }