- Template sections placed above or to the right of the typing keys; the user picks any mix in settings, typing keys included - keysym keys send XKB keysyms on press, optionally repeating - Geometry lays blocks side by side with one key unit; stretch keys are resolved at layout time so composed blocks line up - Toggling a block resizes the window so keys keep their size Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
65 lines
1.9 KiB
QML
65 lines
1.9 KiB
QML
import QtQuick
|
|
import Sloposk
|
|
|
|
// Replaces the keys while open. Binds straight to Settings, which persists.
|
|
Rectangle {
|
|
id: panel
|
|
|
|
required property Settings settings
|
|
required property LayoutModel layoutModel
|
|
|
|
color: Theme.background
|
|
radius: Theme.windowRadius
|
|
|
|
Row {
|
|
id: columns
|
|
readonly property real columnWidth: (width - spacing) / 2
|
|
|
|
anchors { fill: parent; margins: 16 }
|
|
spacing: 32
|
|
|
|
Column {
|
|
width: columns.columnWidth
|
|
spacing: 4
|
|
|
|
SectionHeader { text: qsTr("Typing") }
|
|
|
|
ToggleRow {
|
|
width: parent.width
|
|
text: qsTr("Auto-Capitalization")
|
|
detail: qsTr("Shift at the start of a sentence")
|
|
checked: panel.settings.autoCapitalize
|
|
onToggled: checked => panel.settings.autoCapitalize = checked
|
|
}
|
|
|
|
ToggleRow {
|
|
width: parent.width
|
|
text: qsTr("“.” Shortcut")
|
|
detail: qsTr("Double-tap space for a period and a space")
|
|
checked: panel.settings.doubleSpacePeriod
|
|
onToggled: checked => panel.settings.doubleSpacePeriod = checked
|
|
}
|
|
}
|
|
|
|
Column {
|
|
width: columns.columnWidth
|
|
spacing: 4
|
|
|
|
SectionHeader { text: qsTr("Keys") }
|
|
|
|
Repeater {
|
|
// "main" is the typing keys; the rest come from the template.
|
|
model: [{ id: "main", name: qsTr("Typing keys") }].concat(panel.layoutModel.sections)
|
|
|
|
ToggleRow {
|
|
required property var modelData
|
|
width: parent.width
|
|
text: modelData.name
|
|
checked: panel.settings.visibleSections.includes(modelData.id)
|
|
onToggled: checked => panel.settings.setSectionVisible(modelData.id, checked)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|