mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-07 14:05:38 -05:00
Settings globally, refactor some menus
This commit is contained in:
@@ -14,7 +14,6 @@ PanelWindow {
|
||||
property var theme: Theme
|
||||
property bool hasActiveMedia: root.hasActiveMedia
|
||||
property var weather: root.weather
|
||||
property bool useFahrenheit: false
|
||||
|
||||
property bool showMediaPlayer: hasActiveMedia || hideMediaTimer.running
|
||||
|
||||
@@ -202,7 +201,6 @@ PanelWindow {
|
||||
height: weather ? 140 : 80
|
||||
theme: centerCommandCenter.theme
|
||||
weather: centerCommandCenter.weather
|
||||
useFahrenheit: centerCommandCenter.useFahrenheit
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -237,10 +237,11 @@ Rectangle {
|
||||
if (modelData.allDay) {
|
||||
return "All day"
|
||||
} else {
|
||||
let startTime = Qt.formatTime(modelData.start, "h:mm AP")
|
||||
let timeFormat = Prefs.use24HourClock ? "H:mm" : "h:mm AP"
|
||||
let startTime = Qt.formatTime(modelData.start, timeFormat)
|
||||
if (modelData.start.toDateString() !== modelData.end.toDateString() ||
|
||||
modelData.start.getTime() !== modelData.end.getTime()) {
|
||||
return startTime + " – " + Qt.formatTime(modelData.end, "h:mm AP")
|
||||
return startTime + " – " + Qt.formatTime(modelData.end, timeFormat)
|
||||
}
|
||||
return startTime
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ Rectangle {
|
||||
|
||||
property var theme: Theme
|
||||
property var weather
|
||||
property bool useFahrenheit: false
|
||||
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
@@ -80,7 +79,7 @@ Rectangle {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
Text {
|
||||
text: weather ? ((useFahrenheit ? weather.tempF : weather.temp) + "°" + (useFahrenheit ? "F" : "C")) : ""
|
||||
text: weather ? ((Prefs.useFahrenheit ? weather.tempF : weather.temp) + "°" + (Prefs.useFahrenheit ? "F" : "C")) : ""
|
||||
font.pixelSize: theme.fontSizeXLarge
|
||||
color: theme.surfaceText
|
||||
font.weight: Font.Light
|
||||
@@ -89,7 +88,7 @@ Rectangle {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: if (weather) useFahrenheit = !useFahrenheit
|
||||
onClicked: if (weather) Prefs.setTemperatureUnit(!Prefs.useFahrenheit)
|
||||
enabled: weather !== null
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user