anchors.fill: parent
anchors.margins: UIConstants.DEFAULT_MARGIN
- contentHeight: content_column.height + 2 * UIConstants.DEFAULT_MARGIN
+ //contentHeight: content_column.height + 2 * UIConstants.DEFAULT_MARGIN
flickableDirection: Flickable.VerticalFlick
Component.onCompleted: {
anchors.left: parent.left
}
+ SettingsHeader {
+ text: 'Location'
+ }
+
Row {
anchors.left: parent.left
anchors.right: parent.right
color: !theme.inverted ? UIConstants.COLOR_FOREGROUND : UIConstants.COLOR_INVERTED_FOREGROUND
anchors.verticalCenter: parent.verticalCenter
}
- CheckBox {
+ Switch {
id: gpsEnable
anchors.right: parent.right
checked: config.getGpsEnabled()
id:updateDialog
}
- Row {
- anchors.left: parent.left
- anchors.right: parent.right
- Text {
- text: "Update stations"
- anchors.left: parent.left
- font.pixelSize: UIConstants.FONT_LARGE
- color: !theme.inverted ? UIConstants.COLOR_FOREGROUND : UIConstants.COLOR_INVERTED_FOREGROUND
- anchors.verticalCenter: parent.verticalCenter
- }
+ SettingsHeader {
+ text: 'Station List'
+ }
- Button {
- id: btnUpdate
- anchors.right: parent.right
- text: "Update"
- width: 100
+ Button {
+ id: btnUpdate
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: "Update stations"
+ width: parent.width * .7
- Component.onCompleted: {
- if (config.checkStationsUpdate()) {
- btnUpdate.color = "green"
- }
+ Component.onCompleted: {
+ if (config.checkStationsUpdate()) {
+ btnUpdate.color = "green"
}
+ }
- onClicked: {
- var updateAvailable = config.checkStationsUpdate();
- if (updateAvailable) {
- var updated = config.updateStations();
- if (updated !== '') {
- updateDialog.text = "Stations updated\nPlease restart app"
- txtLastUpdate.text = updated
- } else {
- updateDialog.text = "[UpdateError]:\nTry again later or send me an email:\n<gotovienna@logic.at>"
- }
+ onClicked: {
+ var updateAvailable = config.checkStationsUpdate();
+ if (updateAvailable) {
+ var updated = config.updateStations();
+ if (updated !== '') {
+ updateDialog.text = "Stations updated\nPlease restart app"
+ txtLastUpdate.text = updated
} else {
- updateDialog.text = "No updates available";
+ updateDialog.text = "[UpdateError]:\nTry again later or send me an email:\n<gotovienna@logic.at>"
}
- updateDialog.open();
+ } else {
+ updateDialog.text = "No updates available";
}
+ updateDialog.open();
}
}
--- /dev/null
+
+import QtQuick 1.0
+
+Item {
+ id: settingsHeader
+ property alias text: headerCaption.text
+ property color color: headerCaption.visible?'#666':'#fff'
+
+ width: parent.width
+ height: headerCaption.visible?60*.7:10
+
+ Rectangle {
+ id: horizontalLine
+
+ anchors {
+ left: parent.left
+ right: headerCaption.left
+ rightMargin: headerCaption.visible?16:0
+ verticalCenter: headerCaption.verticalCenter
+ }
+
+ height: 1
+ color: settingsHeader.color
+ }
+
+ Text {
+ id: headerCaption
+ text: ''
+ visible: text !== ''
+ color: settingsHeader.color
+ font.pixelSize: 17
+
+ anchors {
+ right: parent.right
+ bottom: parent.bottom
+ }
+ }
+}
+