feat(ui): style app menus and extract glossary dialog
- Add AppMenu and AppMenuItem so menu labels, mnemonics and shortcuts render consistently under org.kde.union - Move the translation glossary into GlossaryDialog with add, remove and clear-all actions - Regroup the translation preset and instructions settings layout
This commit was merged in pull request #3.
This commit is contained in:
1 parent
9e55dba687
commit
de9e6484ee
24 files changed
+533
-166
No files matched your search
@@ -147,36 +147,35 @@ SettingsBasePage {
|
||||
|
||||
Label {
|
||||
text: KI18n.i18nc("@label:listbox", "Preset")
|
||||
Layout.alignment: Qt.AlignRight | Qt.AlignTop
|
||||
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
ComboBox {
|
||||
id: presetCombo
|
||||
Layout.fillWidth: true
|
||||
|
||||
ComboBox {
|
||||
id: presetCombo
|
||||
Layout.fillWidth: true
|
||||
model: root.translator.translationPresets
|
||||
textRole: "name"
|
||||
valueRole: "id"
|
||||
Component.onCompleted: currentIndex = Math.max(0, indexOfValue(QtPotatoSettings.translationPreset))
|
||||
onActivated: {
|
||||
QtPotatoSettings.translationPreset = currentValue
|
||||
QtPotatoSettings.save()
|
||||
}
|
||||
model: root.translator.translationPresets
|
||||
textRole: "name"
|
||||
valueRole: "id"
|
||||
Component.onCompleted: currentIndex = Math.max(0, indexOfValue(QtPotatoSettings.translationPreset))
|
||||
onActivated: {
|
||||
QtPotatoSettings.translationPreset = currentValue
|
||||
QtPotatoSettings.save()
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
text: presetCombo.currentIndex >= 0 ? presetCombo.model[presetCombo.currentIndex].guidance : ""
|
||||
wrapMode: Text.WordWrap
|
||||
opacity: 0.7
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Item { Layout.preferredWidth: 1 }
|
||||
|
||||
Label {
|
||||
text: presetCombo.currentIndex >= 0 ? presetCombo.model[presetCombo.currentIndex].description : ""
|
||||
wrapMode: Text.WordWrap
|
||||
opacity: 0.7
|
||||
font: Kirigami.Theme.smallFont
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
Label {
|
||||
text: KI18n.i18nc("@label:textbox", "Additional instructions")
|
||||
Layout.alignment: Qt.AlignRight | Qt.AlignTop
|
||||
Layout.alignment: Qt.AlignRight | Qt.AlignBaseline
|
||||
}
|
||||
|
||||
TextArea {
|
||||
@@ -184,6 +183,7 @@ SettingsBasePage {
|
||||
placeholderText: KI18n.i18nc("@info:placeholder", "e.g. Translate 'Young Master' as 'Thiếu gia'. Use 'ta/ngươi' between enemies.")
|
||||
wrapMode: TextArea.Wrap
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignBaseline
|
||||
Layout.preferredHeight: Kirigami.Units.gridUnit * 4
|
||||
// TextArea has no textEdited before Qt 6.9.
|
||||
onTextChanged: QtPotatoSettings.customInstructions = text
|
||||
|
||||
Reference in new issue
Block a user