From 0e83586cae08ff67380813d133c915288e124adc Mon Sep 17 00:00:00 2001 From: Andrey Zaharow <59512038+andr13@users.noreply.github.com> Date: Wed, 20 Mar 2024 17:20:09 +0200 Subject: [PATCH] Fix UI for Burmese language (#682) * Fix UI for Burmese language --- client/ui/models/languageModel.cpp | 9 +++++++++ client/ui/models/languageModel.h | 2 ++ client/ui/qml/Controls2/TextTypes/CaptionTextType.qml | 2 +- client/ui/qml/Controls2/TextTypes/Header1TextType.qml | 2 +- client/ui/qml/Controls2/TextTypes/Header2TextType.qml | 2 +- client/ui/qml/Controls2/TextTypes/LabelTextType.qml | 2 +- client/ui/qml/Controls2/TextTypes/ListItemTitleType.qml | 2 +- client/ui/qml/Controls2/TextTypes/ParagraphTextType.qml | 2 +- client/ui/qml/Controls2/TextTypes/SmallTextType.qml | 2 +- 9 files changed, 18 insertions(+), 7 deletions(-) diff --git a/client/ui/models/languageModel.cpp b/client/ui/models/languageModel.cpp index 28652d2b..0c408a51 100644 --- a/client/ui/models/languageModel.cpp +++ b/client/ui/models/languageModel.cpp @@ -81,6 +81,15 @@ int LanguageModel::getCurrentLanguageIndex() } } +int LanguageModel::getLineHeightAppend() +{ + int langIndex = getCurrentLanguageIndex(); + switch (langIndex) { + case 5: return 10; break; // Burmese + default: return 0; break; + } +} + QString LanguageModel::getCurrentLanguageName() { return m_availableLanguages[getCurrentLanguageIndex()].name; diff --git a/client/ui/models/languageModel.h b/client/ui/models/languageModel.h index fe4b9fbd..f3516e2d 100644 --- a/client/ui/models/languageModel.h +++ b/client/ui/models/languageModel.h @@ -49,10 +49,12 @@ public: Q_PROPERTY(QString currentLanguageName READ getCurrentLanguageName NOTIFY translationsUpdated) Q_PROPERTY(int currentLanguageIndex READ getCurrentLanguageIndex NOTIFY translationsUpdated) + Q_PROPERTY(int lineHeightAppend READ getLineHeightAppend NOTIFY translationsUpdated) public slots: void changeLanguage(const LanguageSettings::AvailableLanguageEnum language); int getCurrentLanguageIndex(); + int getLineHeightAppend(); QString getCurrentLanguageName(); signals: diff --git a/client/ui/qml/Controls2/TextTypes/CaptionTextType.qml b/client/ui/qml/Controls2/TextTypes/CaptionTextType.qml index f7acb6dd..4da2c960 100644 --- a/client/ui/qml/Controls2/TextTypes/CaptionTextType.qml +++ b/client/ui/qml/Controls2/TextTypes/CaptionTextType.qml @@ -1,7 +1,7 @@ import QtQuick Text { - lineHeight: 16 + lineHeight: 16 + LanguageModel.getLineHeightAppend() lineHeightMode: Text.FixedHeight color: "#0E0E11" diff --git a/client/ui/qml/Controls2/TextTypes/Header1TextType.qml b/client/ui/qml/Controls2/TextTypes/Header1TextType.qml index 86b61d7a..754ee2e4 100644 --- a/client/ui/qml/Controls2/TextTypes/Header1TextType.qml +++ b/client/ui/qml/Controls2/TextTypes/Header1TextType.qml @@ -1,7 +1,7 @@ import QtQuick Text { - lineHeight: 38 + lineHeight: 38 + LanguageModel.getLineHeightAppend() lineHeightMode: Text.FixedHeight color: "#D7D8DB" diff --git a/client/ui/qml/Controls2/TextTypes/Header2TextType.qml b/client/ui/qml/Controls2/TextTypes/Header2TextType.qml index 9e2a8ae9..5e27cc67 100644 --- a/client/ui/qml/Controls2/TextTypes/Header2TextType.qml +++ b/client/ui/qml/Controls2/TextTypes/Header2TextType.qml @@ -1,7 +1,7 @@ import QtQuick Text { - lineHeight: 30 + lineHeight: 30 + LanguageModel.getLineHeightAppend() lineHeightMode: Text.FixedHeight color: "#D7D8DB" diff --git a/client/ui/qml/Controls2/TextTypes/LabelTextType.qml b/client/ui/qml/Controls2/TextTypes/LabelTextType.qml index d47d460d..8c76616d 100644 --- a/client/ui/qml/Controls2/TextTypes/LabelTextType.qml +++ b/client/ui/qml/Controls2/TextTypes/LabelTextType.qml @@ -1,7 +1,7 @@ import QtQuick Text { - lineHeight: 16 + lineHeight: 16 + LanguageModel.getLineHeightAppend() lineHeightMode: Text.FixedHeight color: "#878B91" diff --git a/client/ui/qml/Controls2/TextTypes/ListItemTitleType.qml b/client/ui/qml/Controls2/TextTypes/ListItemTitleType.qml index 917e65de..e6119c65 100644 --- a/client/ui/qml/Controls2/TextTypes/ListItemTitleType.qml +++ b/client/ui/qml/Controls2/TextTypes/ListItemTitleType.qml @@ -1,7 +1,7 @@ import QtQuick Text { - lineHeight: 21.6 + lineHeight: 21.6 + LanguageModel.getLineHeightAppend() lineHeightMode: Text.FixedHeight color: "#D7D8DB" diff --git a/client/ui/qml/Controls2/TextTypes/ParagraphTextType.qml b/client/ui/qml/Controls2/TextTypes/ParagraphTextType.qml index a53ca67e..6613e2ed 100644 --- a/client/ui/qml/Controls2/TextTypes/ParagraphTextType.qml +++ b/client/ui/qml/Controls2/TextTypes/ParagraphTextType.qml @@ -1,7 +1,7 @@ import QtQuick Text { - lineHeight: 24 + lineHeight: 24 + LanguageModel.getLineHeightAppend() lineHeightMode: Text.FixedHeight color: "#D7D8DB" diff --git a/client/ui/qml/Controls2/TextTypes/SmallTextType.qml b/client/ui/qml/Controls2/TextTypes/SmallTextType.qml index d1b24e6a..da7510fc 100644 --- a/client/ui/qml/Controls2/TextTypes/SmallTextType.qml +++ b/client/ui/qml/Controls2/TextTypes/SmallTextType.qml @@ -1,7 +1,7 @@ import QtQuick Text { - lineHeight: 20 + lineHeight: 20 + LanguageModel.getLineHeightAppend() lineHeightMode: Text.FixedHeight color: "#D7D8DB"