Clock fully migrated to new user settings
This commit is contained in:
parent
fb01392bc3
commit
f95c9b76d4
3 changed files with 15 additions and 6 deletions
|
|
@ -124,7 +124,7 @@ Singleton {
|
||||||
widget.showDate = adapter.location.showDateWithClock
|
widget.showDate = adapter.location.showDateWithClock
|
||||||
widget.use12HourClock = adapter.location.use12HourClock
|
widget.use12HourClock = adapter.location.use12HourClock
|
||||||
widget.reverseDayMonth = adapter.location.reverseDayMonth
|
widget.reverseDayMonth = adapter.location.reverseDayMonth
|
||||||
widget.showSeconds = BarWidgetRegistry.widgetMetadata[widget.id].reverseDayMonth
|
widget.showSeconds = BarWidgetRegistry.widgetMetadata[widget.id].showSeconds
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,13 +28,13 @@ Rectangle {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resolve settings: try user settings or defaults from BarWidgetRegistry
|
// Resolve settings: try user settings or defaults from BarWidgetRegistry
|
||||||
readonly property bool showDate: widgetSettings.showDate || BarWidgetRegistry.widgetMetadata["Clock"].showDate
|
readonly property bool showDate: widgetSettings.showDate
|
||||||
|
!== undefined ? widgetSettings.showDate : BarWidgetRegistry.widgetMetadata["Clock"].showDate
|
||||||
readonly property bool use12h: widgetSettings.use12HourClock
|
readonly property bool use12h: widgetSettings.use12HourClock
|
||||||
|| BarWidgetRegistry.widgetMetadata["Clock"].use12HourClock
|
!== undefined ? widgetSettings.use12HourClock : BarWidgetRegistry.widgetMetadata["Clock"].use12HourClock
|
||||||
readonly property bool showSeconds: widgetSettings.showSeconds
|
readonly property bool showSeconds: widgetSettings.showSeconds
|
||||||
|| BarWidgetRegistry.widgetMetadata["Clock"].showSeconds
|
!== undefined ? widgetSettings.showSeconds : BarWidgetRegistry.widgetMetadata["Clock"].showSeconds
|
||||||
readonly property bool reverseDayMonth: widgetSettings.reverseDayMonth
|
readonly property bool reverseDayMonth: widgetSettings.reverseDayMonth !== undefined ? widgetSettings.reverseDayMonth : BarWidgetRegistry.widgetMetadata["Clock"].reverseDayMonth
|
||||||
|| BarWidgetRegistry.widgetMetadata["Clock"].reverseDayMonth
|
|
||||||
|
|
||||||
implicitWidth: clock.width + Style.marginM * 2 * scaling
|
implicitWidth: clock.width + Style.marginM * 2 * scaling
|
||||||
implicitHeight: Math.round(Style.capsuleHeight * scaling)
|
implicitHeight: Math.round(Style.capsuleHeight * scaling)
|
||||||
|
|
|
||||||
|
|
@ -273,12 +273,15 @@ Popup {
|
||||||
!== undefined ? settingsPopup.widgetData.use12HourClock : BarWidgetRegistry.widgetMetadata["Clock"].use12HourClock
|
!== undefined ? settingsPopup.widgetData.use12HourClock : BarWidgetRegistry.widgetMetadata["Clock"].use12HourClock
|
||||||
property bool valueShowSeconds: settingsPopup.widgetData.showSeconds
|
property bool valueShowSeconds: settingsPopup.widgetData.showSeconds
|
||||||
!== undefined ? settingsPopup.widgetData.showSeconds : BarWidgetRegistry.widgetMetadata["Clock"].showSeconds
|
!== undefined ? settingsPopup.widgetData.showSeconds : BarWidgetRegistry.widgetMetadata["Clock"].showSeconds
|
||||||
|
property bool valueReverseDayMonth: settingsPopup.widgetData.reverseDayMonth
|
||||||
|
!== undefined ? settingsPopup.widgetData.reverseDayMonth : BarWidgetRegistry.widgetMetadata["Clock"].reverseDayMonth
|
||||||
|
|
||||||
function saveSettings() {
|
function saveSettings() {
|
||||||
var settings = Object.assign({}, settingsPopup.widgetData)
|
var settings = Object.assign({}, settingsPopup.widgetData)
|
||||||
settings.showDate = valueShowDate
|
settings.showDate = valueShowDate
|
||||||
settings.use12HourClock = valueUse12h
|
settings.use12HourClock = valueUse12h
|
||||||
settings.showSeconds = valueShowSeconds
|
settings.showSeconds = valueShowSeconds
|
||||||
|
settings.reverseDayMonth = valueReverseDayMonth
|
||||||
return settings
|
return settings
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -299,6 +302,12 @@ Popup {
|
||||||
checked: valueShowSeconds
|
checked: valueShowSeconds
|
||||||
onToggled: checked => valueShowSeconds = checked
|
onToggled: checked => valueShowSeconds = checked
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NCheckbox {
|
||||||
|
label: "Reverse day and month"
|
||||||
|
checked: valueReverseDayMonth
|
||||||
|
onToggled: checked => valueReverseDayMonth = checked
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue