From c3ca0c43e8534282f4d3f600ea85864e15926f8f Mon Sep 17 00:00:00 2001 From: Dmitriy Purgin Date: Thu, 31 Oct 2024 11:13:10 +0100 Subject: [PATCH] Added Russian and Ukrainian layouts --- src/DeclarativeInputEngine.cpp | 5 +- src/DeclarativeInputEngine.h | 2 + src/qml/RuLayout.qml | 232 ++++++++++++++++++++++++++++++++ src/qml/UkLayout.qml | 235 +++++++++++++++++++++++++++++++++ 4 files changed, 473 insertions(+), 1 deletion(-) create mode 100644 src/qml/RuLayout.qml create mode 100644 src/qml/UkLayout.qml diff --git a/src/DeclarativeInputEngine.cpp b/src/DeclarativeInputEngine.cpp index 3c20397..8908e88 100644 --- a/src/DeclarativeInputEngine.cpp +++ b/src/DeclarativeInputEngine.cpp @@ -44,7 +44,10 @@ struct DeclarativeInputEnginePrivate { {DeclarativeInputEngine::LtBs, {"LtSrHrBsLayout", "Bosanski"}}, {DeclarativeInputEngine::CySr, {"CySrBsLayout", "Српски"}}, {DeclarativeInputEngine::LtSr, {"LtSrHrBsLayout", "Srpski"}}, - {DeclarativeInputEngine::Sv, {"SvLayout", "Svenska"}}}; + {DeclarativeInputEngine::Sv, {"SvLayout", "Svenska"}}, + {DeclarativeInputEngine::Ru, {"RuLayout", "Русский", "Пробел"}}, + {DeclarativeInputEngine::Uk, {"UkLayout", "Українська", "Пробіл"}}, + }; }; DeclarativeInputEnginePrivate::DeclarativeInputEnginePrivate( diff --git a/src/DeclarativeInputEngine.h b/src/DeclarativeInputEngine.h index 67b2b00..4e1259a 100644 --- a/src/DeclarativeInputEngine.h +++ b/src/DeclarativeInputEngine.h @@ -54,6 +54,8 @@ class DeclarativeInputEngine : public QObject { LtBs, CySr, LtSr, + Ru, + Uk, EndLayouts }; Q_ENUM(InputLayouts) diff --git a/src/qml/RuLayout.qml b/src/qml/RuLayout.qml new file mode 100644 index 0000000..7d1958e --- /dev/null +++ b/src/qml/RuLayout.qml @@ -0,0 +1,232 @@ +import QtQuick 2.0 +import QtQuick.Layouts 1.12 + +ColumnLayout { + property var inputPanel + + RowLayout { + property real keyWeight: 160 + + Key { + btnText: "й" + inputPanelRef: inputPanel + } + + Key { + btnText: "ц" + inputPanelRef: inputPanel + } + + Key { + btnText: "у" + inputPanelRef: inputPanel + } + + Key { + btnText: "к" + inputPanelRef: inputPanel + } + + Key { + btnText: "е" + alternativeKeys: "ё" + inputPanelRef: inputPanel + } + + Key { + btnText: "н" + inputPanelRef: inputPanel + } + + Key { + btnText: "г" + inputPanelRef: inputPanel + } + + Key { + btnText: "ш" + inputPanelRef: inputPanel + } + + Key { + btnText: "щ" + inputPanelRef: inputPanel + } + + Key { + btnText: "з" + inputPanelRef: inputPanel + } + + Key { + btnText: "х" + inputPanelRef: inputPanel + } + + BackspaceKey { + inputPanelRef: inputPanel + } + + } + + RowLayout { + property real keyWeight: 160 + + Key { + weight: 56 + functionKey: true + showPreview: false + btnBackground: "transparent" + } + + Key { + btnText: "ф" + inputPanelRef: inputPanel + } + + Key { + btnText: "ы" + inputPanelRef: inputPanel + } + + Key { + btnText: "в" + inputPanelRef: inputPanel + } + + Key { + btnText: "а" + inputPanelRef: inputPanel + } + + Key { + btnText: "п" + inputPanelRef: inputPanel + } + + Key { + btnText: "р" + inputPanelRef: inputPanel + } + + Key { + btnText: "о" + inputPanelRef: inputPanel + } + + Key {s + btnText: "л" + inputPanelRef: inputPanel + } + + Key { + btnText: "д" + inputPanelRef: inputPanel + } + + Key { + btnText: "ж" + inputPanelRef: inputPanel + } + + Key { + btnText: "э" + inputPanelRef: inputPanel + } + + EnterKey { + weight: 283 + inputPanelRef: inputPanel + } + } + + RowLayout { + property real keyWeight: 156 + + ShiftKey { + } + + Key { + btnText: "я" + inputPanelRef: inputPanel + } + + Key { + btnText: "ч" + inputPanelRef: inputPanel + } + + Key { + btnText: "с" + inputPanelRef: inputPanel + } + + Key { + btnText: "м" + inputPanelRef: inputPanel + } + + Key { + btnText: "и" + inputPanelRef: inputPanel + } + + Key { + btnText: "т" + inputPanelRef: inputPanel + } + + Key { + btnText: "ь" + alternativeKeys: "ъ" + inputPanelRef: inputPanel + } + + Key { + btnText: "б" + inputPanelRef: inputPanel + } + + Key { + btnText: "ю" + inputPanelRef: inputPanel + } + + ShiftKey { + weight: 204 + } + + } + + RowLayout { + property real keyWeight: 154 + + SymbolKey { + weight: availableLanguageLayouts.length === 1 ? 217 : 108.5 + } + + LanguageKey { + visible: availableLanguageLayouts.length > 1 + weight: 108.5 + } + + SpaceKey { + weight: 1168 + inputPanelRef: inputPanel + btnDisplayedText: langDescription + } + + Key { + btnKey: Qt.Key_Period + btnText: "." + alternativeKeys: "," + inputPanelRef: inputPanel + } + + HideKey { + weight: 205 + } + + } + +} diff --git a/src/qml/UkLayout.qml b/src/qml/UkLayout.qml new file mode 100644 index 0000000..71afe49 --- /dev/null +++ b/src/qml/UkLayout.qml @@ -0,0 +1,235 @@ +import QtQuick 2.0 +import QtQuick.Layouts 1.12 + +ColumnLayout { + property var inputPanel + + RowLayout { + property real keyWeight: 160 + + Key { + btnText: "й" + inputPanelRef: inputPanel + } + + Key { + btnText: "ц" + inputPanelRef: inputPanel + } + + Key { + btnText: "у" + inputPanelRef: inputPanel + } + + Key { + btnText: "к" + inputPanelRef: inputPanel + } + + Key { + btnText: "е" + alternativeKeys: "ё" + inputPanelRef: inputPanel + } + + Key { + btnText: "н" + inputPanelRef: inputPanel + } + + Key { + btnText: "г" + alternativeKeys: "ґ" + inputPanelRef: inputPanel + } + + Key { + btnText: "ш" + inputPanelRef: inputPanel + } + + Key { + btnText: "щ" + inputPanelRef: inputPanel + } + + Key { + btnText: "з" + inputPanelRef: inputPanel + } + + Key { + btnText: "х" + inputPanelRef: inputPanel + } + + BackspaceKey { + inputPanelRef: inputPanel + } + + } + + RowLayout { + property real keyWeight: 160 + + Key { + weight: 56 + functionKey: true + showPreview: false + btnBackground: "transparent" + } + + Key { + btnText: "ф" + inputPanelRef: inputPanel + } + + Key { + btnText: "і" + alternativeKeys: "ї" + inputPanelRef: inputPanel + } + + Key { + btnText: "в" + inputPanelRef: inputPanel + } + + Key { + btnText: "а" + inputPanelRef: inputPanel + } + + Key { + btnText: "п" + inputPanelRef: inputPanel + } + + Key { + btnText: "р" + inputPanelRef: inputPanel + } + + Key { + btnText: "о" + inputPanelRef: inputPanel + } + + Key { + btnText: "л" + inputPanelRef: inputPanel + } + + Key { + btnText: "д" + inputPanelRef: inputPanel + } + + Key { + btnText: "ж" + inputPanelRef: inputPanel + } + + Key { + btnText: "є" + alternativeKeys: "э" + inputPanelRef: inputPanel + } + + EnterKey { + weight: 283 + inputPanelRef: inputPanel + } + } + + RowLayout { + property real keyWeight: 156 + + ShiftKey { + } + + Key { + btnText: "я" + inputPanelRef: inputPanel + } + + Key { + btnText: "ч" + inputPanelRef: inputPanel + } + + Key { + btnText: "с" + inputPanelRef: inputPanel + } + + Key { + btnText: "м" + inputPanelRef: inputPanel + } + + Key { + btnText: "и" + inputPanelRef: inputPanel + } + + Key { + btnText: "т" + inputPanelRef: inputPanel + } + + Key { + btnText: "ь" + alternativeKeys: "ъ" + inputPanelRef: inputPanel + } + + Key { + btnText: "б" + inputPanelRef: inputPanel + } + + Key { + btnText: "ю" + inputPanelRef: inputPanel + } + + ShiftKey { + weight: 204 + } + + } + + RowLayout { + property real keyWeight: 154 + + SymbolKey { + weight: availableLanguageLayouts.length === 1 ? 217 : 108.5 + } + + LanguageKey { + visible: availableLanguageLayouts.length > 1 + weight: 108.5 + } + + SpaceKey { + weight: 1168 + inputPanelRef: inputPanel + btnDisplayedText: langDescription + } + + Key { + btnKey: Qt.Key_Period + btnText: "." + alternativeKeys: "," + inputPanelRef: inputPanel + } + + HideKey { + weight: 205 + } + + } + +}