From fed0463e57307a3ecaf01dd7d2b54f4d42044e15 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Fri, 20 Mar 2020 21:07:26 +0100 Subject: [PATCH] Make emojis a bit smaller --- .../DeviceVerification.qml | 6 ++--- .../qml/device-verification/EmojiElement.qml | 25 +++++++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 resources/qml/device-verification/EmojiElement.qml diff --git a/resources/qml/device-verification/DeviceVerification.qml b/resources/qml/device-verification/DeviceVerification.qml index d0f4446..f8fe2bd 100644 --- a/resources/qml/device-verification/DeviceVerification.qml +++ b/resources/qml/device-verification/DeviceVerification.qml @@ -267,17 +267,17 @@ ApplicationWindow { model: 7 delegate: Rectangle { color: "transparent" - implicitHeight: Qt.application.font.pixelSize * 8 + implicitHeight: Qt.application.font.pixelSize * 3 implicitWidth: col.width ColumnLayout { id: col anchors.bottom: parent.bottom property var emoji: emojis.mapping[Math.floor(Math.random()*64)] Text { - height: font.pixelSize * 2 + //height: font.pixelSize * 2 Layout.alignment: Qt.AlignHCenter text: col.emoji.emoji - font.pixelSize: Qt.application.font.pixelSize * 4 + font.pixelSize: Qt.application.font.pixelSize * 2 font.family: settings.emoji_font_family } Text { diff --git a/resources/qml/device-verification/EmojiElement.qml b/resources/qml/device-verification/EmojiElement.qml new file mode 100644 index 0000000..fa207b9 --- /dev/null +++ b/resources/qml/device-verification/EmojiElement.qml @@ -0,0 +1,25 @@ +import QtQuick 2.3 +import QtQuick.Layouts 1.10 + +Rectangle { + color: "red" + implicitHeight: Qt.application.font.pixelSize * 4 + implicitWidth: col.width + height: Qt.application.font.pixelSize * 4 + width: col.width + ColumnLayout { + id: col + anchors.bottom: parent.bottom + property var emoji: emojis.mapping[Math.floor(Math.random()*64)] + Text { + height: font.pixelSize * 2 + Layout.alignment: Qt.AlignHCenter + text: col.emoji.emoji + font.pixelSize: Qt.application.font.pixelSize * 2 + } + Text { + Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom + text: col.emoji.description + } + } +}