Style fixing

This commit is contained in:
2018-07-12 21:16:10 +02:00
parent e07e29cd4a
commit 773ad2a91d
5 changed files with 62 additions and 23 deletions

View File

@@ -11,8 +11,8 @@ Page {
ListElement {
name: "serviceUrl"
title: qsTr("nooLite service URL:")
inputHint: Qt.ImhUrlCharactersOnly
title: qsTr("nooLite service URL")
inputMethodHint: Qt.ImhUrlCharactersOnly
}
}
@@ -20,36 +20,43 @@ Page {
model: settingsModel
anchors.fill: parent
anchors.margins: 8
delegate: Item {
id: settingsItem
delegate: SubtitledItemDelegate {
width: parent.width
height: childrenRect.height
text: model.title
subtitle: settings[model.name]
Label {
id: titleLabel
onClicked: inputDialog.open()
anchors.left: settingsItem.left
anchors.verticalCenter: valueField.verticalCenter
Dialog {
id: inputDialog
text: model.title
}
x: (parent.width - width) / 2
y: (parent.height - height) / 2
parent: ApplicationWindow.overlay
TextField {
id: valueField
focus: true
modal: true
title: model.title
standardButtons: Dialog.Ok | Dialog.Cancel
anchors.right: settingsItem.right
anchors.left: titleLabel.right
anchors.leftMargin: 10
Column {
spacing: 20
anchors.fill: parent
inputMethodHints: model.inputHint
TextField {
id: textField
text: settings[model.name]
width: parent.width
focus: true
inputMethodHints: Qt.ImhNoAutoUppercase | model.inputMethodHint
placeholderText: model.title
text: settings[model.name]
}
}
onTextChanged: {
settings[model.name] = text
onAccepted: {
settings[model.name] = textField.text
}
}
}