From 0d1d266c0d812e0343ae56c73f0ab9149c287c61 Mon Sep 17 00:00:00 2001 From: Nils Assarsson Date: Mon, 17 Jun 2024 13:07:52 +0200 Subject: [PATCH] add swedish language layout --- src/DeclarativeInputEngine.h | 2 +- src/qml/SvLayout.qml | 268 +++++++++++++++++++++++++++++++++++ 2 files changed, 269 insertions(+), 1 deletion(-) create mode 100644 src/qml/SvLayout.qml diff --git a/src/DeclarativeInputEngine.h b/src/DeclarativeInputEngine.h index d75d0f5..ca8cff0 100644 --- a/src/DeclarativeInputEngine.h +++ b/src/DeclarativeInputEngine.h @@ -37,7 +37,7 @@ class DeclarativeInputEngine : public QObject { /** * The InputLayouts enum provides a list of valid input layouts */ - enum InputLayouts { En, Fr, It, Es, De, Nl, Pt, Cs, El, Pl, EndLayouts }; + enum InputLayouts { En, Fr, It, Es, De, Nl, Pt, Cs, El, Pl, Sv, EndLayouts }; Q_ENUM(InputLayouts) /** diff --git a/src/qml/SvLayout.qml b/src/qml/SvLayout.qml new file mode 100644 index 0000000..812188b --- /dev/null +++ b/src/qml/SvLayout.qml @@ -0,0 +1,268 @@ +import QtQuick 2.0 +import QtQuick.Layouts 1.12 + +ColumnLayout { + property var inputPanel + + RowLayout { + property real keyWeight: 160 + + Key { + btnKey: Qt.Key_Q + btnText: "q" + inputPanelRef: inputPanel + } + + Key { + btnKey: Qt.Key_W + btnText: "w" + inputPanelRef: inputPanel + } + + Key { + btnKey: Qt.Key_E + btnText: "e" + inputPanelRef: inputPanel + } + + Key { + btnKey: Qt.Key_R + btnText: "r" + inputPanelRef: inputPanel + } + + Key { + btnKey: Qt.Key_T + btnText: "t" + inputPanelRef: inputPanel + } + + Key { + btnKey: Qt.Key_Y + btnText: "y" + inputPanelRef: inputPanel + } + + Key { + btnKey: Qt.Key_U + btnText: "u" + inputPanelRef: inputPanel + } + + Key { + btnKey: Qt.Key_I + btnText: "i" + inputPanelRef: inputPanel + } + + Key { + btnKey: Qt.Key_O + btnText: "o" + inputPanelRef: inputPanel + } + + Key { + btnKey: Qt.Key_P + btnText: "p" + inputPanelRef: inputPanel + } + + Key { + btnKey: Qt.Key_Aring + btnText: "å" + inputPanelRef: inputPanel + } + + BackspaceKey { + inputPanelRef: inputPanel + } + + } + + RowLayout { + property real keyWeight: 160 + + Key { + weight: 56 + functionKey: true + showPreview: false + btnBackground: "transparent" + } + + Key { + btnKey: Qt.Key_A + btnText: "a" + inputPanelRef: inputPanel + } + + Key { + btnKey: Qt.Key_S + btnText: "s" + alternativeKeys: "ß" + inputPanelRef: inputPanel + } + + Key { + btnKey: Qt.Key_D + btnText: "d" + inputPanelRef: inputPanel + } + + Key { + btnKey: Qt.Key_F + btnText: "f" + inputPanelRef: inputPanel + } + + Key { + btnKey: Qt.Key_G + btnText: "g" + inputPanelRef: inputPanel + } + + Key { + btnKey: Qt.Key_H + btnText: "h" + inputPanelRef: inputPanel + } + + Key { + btnKey: Qt.Key_J + btnText: "j" + inputPanelRef: inputPanel + } + + Key { + btnKey: Qt.Key_K + btnText: "k" + inputPanelRef: inputPanel + } + + Key { + btnKey: Qt.Key_L + btnText: "l" + inputPanelRef: inputPanel + } + + Key { + btnKey: Qt.Key_Odiaeresis + btnText: "ö" + inputPanelRef: inputPanel + } + + Key { + btnKey: Qt.Key_Adiaeresis + btnText: "ä" + inputPanelRef: inputPanel + } + + EnterKey { + weight: 283 + inputPanelRef: inputPanel + } + + } + + RowLayout { + property real keyWeight: 156 + + ShiftKey { + } + + Key { + btnKey: Qt.Key_Z + btnText: "z" + inputPanelRef: inputPanel + } + + Key { + btnKey: Qt.Key_X + btnText: "x" + inputPanelRef: inputPanel + } + + Key { + btnKey: Qt.Key_C + btnText: "c" + inputPanelRef: inputPanel + } + + Key { + btnKey: Qt.Key_V + btnText: "v" + inputPanelRef: inputPanel + } + + Key { + btnKey: Qt.Key_B + btnText: "b" + inputPanelRef: inputPanel + } + + Key { + btnKey: Qt.Key_N + btnText: "n" + inputPanelRef: inputPanel + } + + Key { + btnKey: Qt.Key_M + btnText: "m" + inputPanelRef: inputPanel + } + + Key { + btnKey: Qt.Key_Comma + btnText: "," + inputPanelRef: inputPanel + } + + Key { + btnKey: Qt.Key_Period + btnText: "." + inputPanelRef: inputPanel + } + + Key { + btnKey: Qt.Key_Minus + 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: "Svenska" + } + + Key { + btnKey: Qt.Key_Apostrophe + btnText: "'" + inputPanelRef: inputPanel + } + + HideKey { + weight: 205 + } + + } + +}