diff --git a/Common/Theme.qml b/Common/Theme.qml index 6d8f6565..f7868903 100644 --- a/Common/Theme.qml +++ b/Common/Theme.qml @@ -59,6 +59,13 @@ Singleton { Component.onCompleted: { Quickshell.execDetached(["mkdir", "-p", stateDir]) + matugenCheck.running = true + if (typeof SessionData !== "undefined") + SessionData.isLightModeChanged.connect(root.onLightModeChanged) + + if (typeof SettingsData !== "undefined" && SettingsData.currentThemeName) { + switchTheme(SettingsData.currentThemeName, false) + } } function getMatugenColor(path, fallback) { @@ -759,16 +766,6 @@ Singleton { } } - Component.onCompleted: { - matugenCheck.running = true - if (typeof SessionData !== "undefined") - SessionData.isLightModeChanged.connect(root.onLightModeChanged) - - if (typeof SettingsData !== "undefined" && SettingsData.currentThemeName) { - switchTheme(SettingsData.currentThemeName, false) - } - } - FileView { id: customThemeFileView watchChanges: currentTheme === "custom" diff --git a/Modules/Settings/WeatherTab.qml b/Modules/Settings/WeatherTab.qml index 61b7e6d1..eb9c2f21 100644 --- a/Modules/Settings/WeatherTab.qml +++ b/Modules/Settings/WeatherTab.qml @@ -242,6 +242,47 @@ Item { font.weight: Font.Medium } + Row { + width: parent.width + spacing: Theme.spacingM + + DankTextField { + id: latitudeInput + width: (parent.width - Theme.spacingM) / 2 + height: 48 + placeholderText: "Latitude" + text: SettingsData.weatherCoordinates ? SettingsData.weatherCoordinates.split(',')[0] : "" + backgroundColor: Theme.surfaceVariant + normalBorderColor: Theme.primarySelected + focusedBorderColor: Theme.primary + onTextEdited: { + if (text && longitudeInput.text) { + const coords = text + "," + longitudeInput.text + const displayName = `${text}, ${longitudeInput.text}` + SettingsData.setWeatherLocation(displayName, coords) + } + } + } + + DankTextField { + id: longitudeInput + width: (parent.width - Theme.spacingM) / 2 + height: 48 + placeholderText: "Longitude" + text: SettingsData.weatherCoordinates ? SettingsData.weatherCoordinates.split(',')[1] : "" + backgroundColor: Theme.surfaceVariant + normalBorderColor: Theme.primarySelected + focusedBorderColor: Theme.primary + onTextEdited: { + if (text && latitudeInput.text) { + const coords = latitudeInput.text + "," + text + const displayName = `${latitudeInput.text}, ${text}` + SettingsData.setWeatherLocation(displayName, coords) + } + } + } + } + DankLocationSearch { width: parent.width currentLocation: SettingsData.weatherLocation