Skip to content

Commit

Permalink
add swedish language layout
Browse files Browse the repository at this point in the history
  • Loading branch information
niasME authored and AndreaRicchi committed Jun 21, 2024
1 parent d28018d commit 0d1d266
Show file tree
Hide file tree
Showing 2 changed files with 269 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/DeclarativeInputEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)

/**
Expand Down
268 changes: 268 additions & 0 deletions src/qml/SvLayout.qml
Original file line number Diff line number Diff line change
@@ -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
}

}

}

0 comments on commit 0d1d266

Please sign in to comment.