Add basic settings, gotta fix layout

This commit is contained in:
Ly-sec 2025-08-12 00:45:53 +02:00
parent 152272c51a
commit 8cb519e5f4
9 changed files with 537 additions and 71 deletions

View file

@ -13,17 +13,50 @@ Item {
ColumnLayout {
anchors.fill: parent
spacing: Style.marginMedium * scaling
NText {
text: "Time & Weather"
font.weight: Style.fontWeightBold
color: Colors.accentSecondary
NText { text: "Time"; font.weight: Style.fontWeightBold; color: Colors.accentSecondary }
NToggle {
label: "Use 12 Hour Clock"
description: "Display time in 12-hour format (e.g., 2:30 PM) instead of 24-hour format"
value: Settings.data.location.use12HourClock
onToggled: function (newValue) { Settings.data.location.use12HourClock = newValue }
}
NText {
text: "Coming soon"
color: Colors.textSecondary
NToggle {
label: "US Style Date"
description: "Display dates in MM/DD/YYYY format instead of DD/MM/YYYY"
value: Settings.data.location.reverseDayMonth
onToggled: function (newValue) { Settings.data.location.reverseDayMonth = newValue }
}
Item {
Layout.fillHeight: true
NDivider { Layout.fillWidth: true }
NText { text: "Weather"; font.weight: Style.fontWeightBold; color: Colors.accentSecondary }
NText { text: "City"; color: Colors.textPrimary; font.weight: Style.fontWeightBold }
NText { text: "Your city name for weather information"; color: Colors.textSecondary }
NTextBox {
text: Settings.data.location.name
Layout.fillWidth: true
onEditingFinished: Settings.data.location.name = text
}
RowLayout {
Layout.fillWidth: true
spacing: Style.marginSmall * scaling
ColumnLayout { Layout.fillWidth: true; spacing: 2 * scaling
NText { text: "Temperature Unit"; color: Colors.textPrimary; font.weight: Style.fontWeightBold }
NText { text: "Choose between Celsius and Fahrenheit"; color: Colors.textSecondary; wrapMode: Text.WordWrap }
}
NComboBox {
optionsKeys: ["c", "f"]
optionsLabels: ["Celsius", "Fahrenheit"]
currentKey: Settings.data.location.useFahrenheit ? "f" : "c"
onSelected: function (key) { Settings.data.location.useFahrenheit = (key === "f") }
}
}
Item { Layout.fillHeight: true }
}
}