Rename TimeWeatherTab to WeatherTab, remove Time settings from said tab
WeatherTab: renamed from TimeWeatherTab, remove Time settings Time: Time/Date is now widget driven
This commit is contained in:
parent
888ba108e0
commit
e4e2ed41b4
3 changed files with 7 additions and 61 deletions
|
|
@ -9,21 +9,7 @@ Singleton {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property var date: new Date()
|
property var date: new Date()
|
||||||
property string time: {
|
|
||||||
let timeFormat = Settings.data.location.use12HourClock ? "h:mm AP" : "HH:mm"
|
|
||||||
let timeString = Qt.formatDateTime(date, timeFormat)
|
|
||||||
|
|
||||||
if (Settings.data.location.showDateWithClock) {
|
|
||||||
let dayName = date.toLocaleDateString(Qt.locale(), "ddd")
|
|
||||||
dayName = dayName.charAt(0).toUpperCase() + dayName.slice(1)
|
|
||||||
let day = date.getDate()
|
|
||||||
let month = date.toLocaleDateString(Qt.locale(), "MMM")
|
|
||||||
|
|
||||||
return timeString + " - " + (Settings.data.location.reverseDayMonth ? `${dayName}, ${month} ${day}` : `${dayName}, ${day} ${month}`)
|
|
||||||
}
|
|
||||||
|
|
||||||
return timeString
|
|
||||||
}
|
|
||||||
readonly property string dateString: {
|
readonly property string dateString: {
|
||||||
let now = date
|
let now = date
|
||||||
let dayName = now.toLocaleDateString(Qt.locale(), "ddd")
|
let dayName = now.toLocaleDateString(Qt.locale(), "ddd")
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ NPanel {
|
||||||
General,
|
General,
|
||||||
Network,
|
Network,
|
||||||
ScreenRecorder,
|
ScreenRecorder,
|
||||||
TimeWeather,
|
Weather,
|
||||||
Wallpaper,
|
Wallpaper,
|
||||||
WallpaperSelector
|
WallpaperSelector
|
||||||
}
|
}
|
||||||
|
|
@ -90,8 +90,8 @@ NPanel {
|
||||||
Tabs.NetworkTab {}
|
Tabs.NetworkTab {}
|
||||||
}
|
}
|
||||||
Component {
|
Component {
|
||||||
id: timeWeatherTab
|
id: weatherTab
|
||||||
Tabs.TimeWeatherTab {}
|
Tabs.WeatherTab {}
|
||||||
}
|
}
|
||||||
Component {
|
Component {
|
||||||
id: colorSchemeTab
|
id: colorSchemeTab
|
||||||
|
|
@ -156,10 +156,10 @@ NPanel {
|
||||||
"icon": "brightness_6",
|
"icon": "brightness_6",
|
||||||
"source": brightnessTab
|
"source": brightnessTab
|
||||||
}, {
|
}, {
|
||||||
"id": SettingsPanel.Tab.TimeWeather,
|
"id": SettingsPanel.Tab.Weather,
|
||||||
"label": "Time & Weather",
|
"label": "Weather",
|
||||||
"icon": "schedule",
|
"icon": "partly_cloudy_day",
|
||||||
"source": timeWeatherTab
|
"source": weatherTab
|
||||||
}, {
|
}, {
|
||||||
"id": SettingsPanel.Tab.ColorScheme,
|
"id": SettingsPanel.Tab.ColorScheme,
|
||||||
"label": "Color Scheme",
|
"label": "Color Scheme",
|
||||||
|
|
|
||||||
|
|
@ -52,46 +52,6 @@ ColumnLayout {
|
||||||
Layout.bottomMargin: Style.marginXL * scaling
|
Layout.bottomMargin: Style.marginXL * scaling
|
||||||
}
|
}
|
||||||
|
|
||||||
// Time section
|
|
||||||
ColumnLayout {
|
|
||||||
spacing: Style.marginL * scaling
|
|
||||||
Layout.fillWidth: true
|
|
||||||
|
|
||||||
NText {
|
|
||||||
text: "Time Format"
|
|
||||||
font.pointSize: Style.fontSizeXXL * scaling
|
|
||||||
font.weight: Style.fontWeightBold
|
|
||||||
color: Color.mSecondary
|
|
||||||
}
|
|
||||||
|
|
||||||
NToggle {
|
|
||||||
label: "Use 12-Hour Clock"
|
|
||||||
description: "Display time in 12-hour format (AM/PM) instead of 24-hour."
|
|
||||||
checked: Settings.data.location.use12HourClock
|
|
||||||
onToggled: checked => Settings.data.location.use12HourClock = checked
|
|
||||||
}
|
|
||||||
|
|
||||||
NToggle {
|
|
||||||
label: "Reverse Day/Month"
|
|
||||||
description: "Display date as dd/mm instead of mm/dd."
|
|
||||||
checked: Settings.data.location.reverseDayMonth
|
|
||||||
onToggled: checked => Settings.data.location.reverseDayMonth = checked
|
|
||||||
}
|
|
||||||
|
|
||||||
NToggle {
|
|
||||||
label: "Show Date with Clock"
|
|
||||||
description: "Display date alongside time (e.g., 18:12 - Sat, 23 Aug)."
|
|
||||||
checked: Settings.data.location.showDateWithClock
|
|
||||||
onToggled: checked => Settings.data.location.showDateWithClock = checked
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
NDivider {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.topMargin: Style.marginXL * scaling
|
|
||||||
Layout.bottomMargin: Style.marginXL * scaling
|
|
||||||
}
|
|
||||||
|
|
||||||
// Weather section
|
// Weather section
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
spacing: Style.marginM * scaling
|
spacing: Style.marginM * scaling
|
||||||
Loading…
Add table
Add a link
Reference in a new issue