Formatting

This commit is contained in:
quadbyte 2025-08-11 18:06:32 -04:00
parent 80c7f663f1
commit 916d86cd97
3 changed files with 8 additions and 11 deletions

View file

@ -96,7 +96,7 @@ NLoader {
Column { Column {
anchors.fill: parent anchors.fill: parent
anchors.margins: Style.marginSmall * scaling anchors.margins: Style.marginSmall * scaling
spacing: 2 * scaling // Minimal spacing between tabs spacing: 2 * scaling // Minimal spacing between tabs
Repeater { Repeater {
id: sections id: sections
@ -106,7 +106,7 @@ NLoader {
id: tabItem id: tabItem
readonly property bool selected: index === settingsPanel.currentTabIndex readonly property bool selected: index === settingsPanel.currentTabIndex
width: parent.width width: parent.width
height: 32 * scaling // Back to original height height: 32 * scaling // Back to original height
radius: Style.radiusSmall * scaling radius: Style.radiusSmall * scaling
color: selected ? Colors.accentPrimary : (tabItem.hovering ? Colors.highlight : "transparent") color: selected ? Colors.accentPrimary : (tabItem.hovering ? Colors.highlight : "transparent")
border.color: "transparent" border.color: "transparent"
@ -212,4 +212,4 @@ NLoader {
} }
} }
} }
} }

View file

@ -40,22 +40,19 @@ Singleton {
} }
} }
Timer { Timer {
id: updateTimer id: updateTimer
interval: 60 * 1000 interval: 60 * 1000
repeat: true repeat: true
onTriggered: { onTriggered: {
updateWeather(); updateWeather()
} }
} }
// -------------------------------- // --------------------------------
function init() { function init() {// does nothing but ensure the singleton is created
// does nothing but ensure the singleton is created
} }
// -------------------------------- // --------------------------------
function updateWeather() { function updateWeather() {
if ((data.weatherLastFetch === "") || (Time.timestamp >= data.weatherLastFetch + weatherUpdateFrequency)) { if ((data.weatherLastFetch === "") || (Time.timestamp >= data.weatherLastFetch + weatherUpdateFrequency)) {
@ -135,7 +132,7 @@ Singleton {
xhr.send() xhr.send()
} }
// -------------------------------- // --------------------------------
function errorCallback(message) { function errorCallback(message) {
console.error(message) console.error(message)
} }

View file

@ -39,8 +39,8 @@ Singleton {
} }
// Returns a Unix Timestamp (in seconds) // Returns a Unix Timestamp (in seconds)
readonly property string timestamp: { readonly property string timestamp: {
return Math.floor(Date.now() / 1000); return Math.floor(Date.now() / 1000)
} }
// Format an easy to read approximate duration ex: 4h32m // Format an easy to read approximate duration ex: 4h32m