Style fixing
This commit is contained in:
@@ -11,8 +11,8 @@ Page {
|
|||||||
|
|
||||||
ListElement {
|
ListElement {
|
||||||
name: "serviceUrl"
|
name: "serviceUrl"
|
||||||
title: qsTr("nooLite service URL:")
|
title: qsTr("nooLite service URL")
|
||||||
inputHint: Qt.ImhUrlCharactersOnly
|
inputMethodHint: Qt.ImhUrlCharactersOnly
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -20,36 +20,43 @@ Page {
|
|||||||
model: settingsModel
|
model: settingsModel
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: 8
|
|
||||||
|
|
||||||
delegate: Item {
|
|
||||||
id: settingsItem
|
|
||||||
|
|
||||||
|
delegate: SubtitledItemDelegate {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: childrenRect.height
|
|
||||||
|
|
||||||
Label {
|
|
||||||
id: titleLabel
|
|
||||||
|
|
||||||
anchors.left: settingsItem.left
|
|
||||||
anchors.verticalCenter: valueField.verticalCenter
|
|
||||||
|
|
||||||
text: model.title
|
text: model.title
|
||||||
}
|
subtitle: settings[model.name]
|
||||||
|
|
||||||
|
onClicked: inputDialog.open()
|
||||||
|
|
||||||
|
Dialog {
|
||||||
|
id: inputDialog
|
||||||
|
|
||||||
|
x: (parent.width - width) / 2
|
||||||
|
y: (parent.height - height) / 2
|
||||||
|
parent: ApplicationWindow.overlay
|
||||||
|
|
||||||
|
focus: true
|
||||||
|
modal: true
|
||||||
|
title: model.title
|
||||||
|
standardButtons: Dialog.Ok | Dialog.Cancel
|
||||||
|
|
||||||
|
Column {
|
||||||
|
spacing: 20
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
TextField {
|
TextField {
|
||||||
id: valueField
|
id: textField
|
||||||
|
|
||||||
anchors.right: settingsItem.right
|
|
||||||
anchors.left: titleLabel.right
|
|
||||||
anchors.leftMargin: 10
|
|
||||||
|
|
||||||
inputMethodHints: model.inputHint
|
|
||||||
|
|
||||||
|
width: parent.width
|
||||||
|
focus: true
|
||||||
|
inputMethodHints: Qt.ImhNoAutoUppercase | model.inputMethodHint
|
||||||
|
placeholderText: model.title
|
||||||
text: settings[model.name]
|
text: settings[model.name]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onTextChanged: {
|
onAccepted: {
|
||||||
settings[model.name] = text
|
settings[model.name] = textField.text
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
24
SubtitledItemDelegate.qml
Normal file
24
SubtitledItemDelegate.qml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import QtQuick 2.0
|
||||||
|
import QtQuick.Controls 2.2
|
||||||
|
|
||||||
|
ItemDelegate {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
property string subtitle: ""
|
||||||
|
|
||||||
|
contentItem: Column {
|
||||||
|
Label {
|
||||||
|
id: titleLabel
|
||||||
|
|
||||||
|
width: parent.width
|
||||||
|
text: root.text
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
width: parent.width
|
||||||
|
font.pixelSize: titleLabel.font.pixelSize - 2
|
||||||
|
text: root.subtitle ? root.subtitle : qsTr("undefined")
|
||||||
|
opacity: 0.8
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
7
main.qml
7
main.qml
@@ -74,4 +74,11 @@ ApplicationWindow {
|
|||||||
initialItem: "HomeForm.qml"
|
initialItem: "HomeForm.qml"
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onClosing: {
|
||||||
|
if (stackView.depth > 1) {
|
||||||
|
close.accepted = false
|
||||||
|
stackView.pop()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
1
qml.qrc
1
qml.qrc
@@ -5,5 +5,6 @@
|
|||||||
<file>HomeForm.qml</file>
|
<file>HomeForm.qml</file>
|
||||||
<file>SettingsForm.qml</file>
|
<file>SettingsForm.qml</file>
|
||||||
<file>MenuBackButton.qml</file>
|
<file>MenuBackButton.qml</file>
|
||||||
|
<file>SubtitledItemDelegate.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
@@ -8,6 +8,6 @@ Style=Material
|
|||||||
[Material]
|
[Material]
|
||||||
Theme=Dark
|
Theme=Dark
|
||||||
Primary=#3C3C3C
|
Primary=#3C3C3C
|
||||||
;Accent=Steel
|
Accent=BlueGrey
|
||||||
;Foreground=Brown
|
;Foreground=Brown
|
||||||
;Background=Steel
|
;Background=Steel
|
||||||
|
|||||||
Reference in New Issue
Block a user