mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-06 05:25:41 -05:00
qmlfmt with 4 space
This commit is contained in:
@@ -24,8 +24,10 @@ Item {
|
||||
width: parent.width
|
||||
height: timeSection.implicitHeight + Theme.spacingL * 2
|
||||
radius: Theme.cornerRadius
|
||||
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
|
||||
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
|
||||
Theme.surfaceVariant.b, 0.3)
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
||||
Theme.outline.b, 0.2)
|
||||
border.width: 1
|
||||
|
||||
Column {
|
||||
@@ -47,7 +49,8 @@ Item {
|
||||
}
|
||||
|
||||
Column {
|
||||
width: parent.width - Theme.iconSize - Theme.spacingM - toggle.width - Theme.spacingM
|
||||
width: parent.width - Theme.iconSize - Theme.spacingM
|
||||
- toggle.width - Theme.spacingM
|
||||
spacing: Theme.spacingXS
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
@@ -65,7 +68,6 @@ Item {
|
||||
wrapMode: Text.WordWrap
|
||||
width: parent.width
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
DankToggle {
|
||||
@@ -73,15 +75,13 @@ Item {
|
||||
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: SettingsData.use24HourClock
|
||||
onToggled: (checked) => {
|
||||
return SettingsData.setClockFormat(checked);
|
||||
}
|
||||
onToggled: checked => {
|
||||
return SettingsData.setClockFormat(
|
||||
checked)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Date Format Section
|
||||
@@ -89,8 +89,10 @@ Item {
|
||||
width: parent.width
|
||||
height: dateSection.implicitHeight + Theme.spacingL * 2
|
||||
radius: Theme.cornerRadius
|
||||
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
|
||||
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
|
||||
Theme.surfaceVariant.b, 0.3)
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
||||
Theme.outline.b, 0.2)
|
||||
border.width: 1
|
||||
|
||||
Column {
|
||||
@@ -118,123 +120,130 @@ Item {
|
||||
color: Theme.surfaceText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
DankDropdown {
|
||||
width: parent.width
|
||||
height: 50
|
||||
text: "Top Bar Format"
|
||||
description: "Preview: " + Qt.formatDate(new Date(), SettingsData.clockDateFormat)
|
||||
description: "Preview: " + Qt.formatDate(
|
||||
new Date(),
|
||||
SettingsData.clockDateFormat)
|
||||
currentValue: {
|
||||
// Find matching preset or show "Custom"
|
||||
const presets = [{
|
||||
"format": "ddd d",
|
||||
"label": "Day Date"
|
||||
}, {
|
||||
"format": "ddd MMM d",
|
||||
"label": "Day Month Date"
|
||||
}, {
|
||||
"format": "MMM d",
|
||||
"label": "Month Date"
|
||||
}, {
|
||||
"format": "M/d",
|
||||
"label": "Numeric (M/D)"
|
||||
}, {
|
||||
"format": "d/M",
|
||||
"label": "Numeric (D/M)"
|
||||
}, {
|
||||
"format": "ddd d MMM yyyy",
|
||||
"label": "Full with Year"
|
||||
}, {
|
||||
"format": "yyyy-MM-dd",
|
||||
"label": "ISO Date"
|
||||
}, {
|
||||
"format": "dddd, MMMM d",
|
||||
"label": "Full Day & Month"
|
||||
}];
|
||||
const match = presets.find((p) => {
|
||||
return p.format === SettingsData.clockDateFormat;
|
||||
});
|
||||
return match ? match.label : "Custom: " + SettingsData.clockDateFormat;
|
||||
"format": "ddd d",
|
||||
"label": "Day Date"
|
||||
}, {
|
||||
"format": "ddd MMM d",
|
||||
"label": "Day Month Date"
|
||||
}, {
|
||||
"format": "MMM d",
|
||||
"label": "Month Date"
|
||||
}, {
|
||||
"format": "M/d",
|
||||
"label": "Numeric (M/D)"
|
||||
}, {
|
||||
"format": "d/M",
|
||||
"label": "Numeric (D/M)"
|
||||
}, {
|
||||
"format": "ddd d MMM yyyy",
|
||||
"label": "Full with Year"
|
||||
}, {
|
||||
"format": "yyyy-MM-dd",
|
||||
"label": "ISO Date"
|
||||
}, {
|
||||
"format": "dddd, MMMM d",
|
||||
"label": "Full Day & Month"
|
||||
}]
|
||||
const match = presets.find(p => {
|
||||
return p.format
|
||||
=== SettingsData.clockDateFormat
|
||||
})
|
||||
return match ? match.label : "Custom: " + SettingsData.clockDateFormat
|
||||
}
|
||||
options: ["Day Date", "Day Month Date", "Month Date", "Numeric (M/D)", "Numeric (D/M)", "Full with Year", "ISO Date", "Full Day & Month", "Custom..."]
|
||||
onValueChanged: (value) => {
|
||||
const formatMap = {
|
||||
"Day Date": "ddd d",
|
||||
"Day Month Date": "ddd MMM d",
|
||||
"Month Date": "MMM d",
|
||||
"Numeric (M/D)": "M/d",
|
||||
"Numeric (D/M)": "d/M",
|
||||
"Full with Year": "ddd d MMM yyyy",
|
||||
"ISO Date": "yyyy-MM-dd",
|
||||
"Full Day & Month": "dddd, MMMM d"
|
||||
};
|
||||
if (value === "Custom...") {
|
||||
customFormatInput.visible = true;
|
||||
} else {
|
||||
customFormatInput.visible = false;
|
||||
SettingsData.setClockDateFormat(formatMap[value]);
|
||||
}
|
||||
}
|
||||
onValueChanged: value => {
|
||||
const formatMap = {
|
||||
"Day Date": "ddd d",
|
||||
"Day Month Date": "ddd MMM d",
|
||||
"Month Date": "MMM d",
|
||||
"Numeric (M/D)": "M/d",
|
||||
"Numeric (D/M)": "d/M",
|
||||
"Full with Year": "ddd d MMM yyyy",
|
||||
"ISO Date": "yyyy-MM-dd",
|
||||
"Full Day & Month": "dddd, MMMM d"
|
||||
}
|
||||
if (value === "Custom...") {
|
||||
customFormatInput.visible = true
|
||||
} else {
|
||||
customFormatInput.visible = false
|
||||
SettingsData.setClockDateFormat(
|
||||
formatMap[value])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DankDropdown {
|
||||
width: parent.width
|
||||
height: 50
|
||||
text: "Lock Screen Format"
|
||||
description: "Preview: " + Qt.formatDate(new Date(), SettingsData.lockDateFormat)
|
||||
description: "Preview: " + Qt.formatDate(
|
||||
new Date(),
|
||||
SettingsData.lockDateFormat)
|
||||
currentValue: {
|
||||
// Find matching preset or show "Custom"
|
||||
const presets = [{
|
||||
"format": "ddd d",
|
||||
"label": "Day Date"
|
||||
}, {
|
||||
"format": "ddd MMM d",
|
||||
"label": "Day Month Date"
|
||||
}, {
|
||||
"format": "MMM d",
|
||||
"label": "Month Date"
|
||||
}, {
|
||||
"format": "M/d",
|
||||
"label": "Numeric (M/D)"
|
||||
}, {
|
||||
"format": "d/M",
|
||||
"label": "Numeric (D/M)"
|
||||
}, {
|
||||
"format": "ddd d MMM yyyy",
|
||||
"label": "Full with Year"
|
||||
}, {
|
||||
"format": "yyyy-MM-dd",
|
||||
"label": "ISO Date"
|
||||
}, {
|
||||
"format": "dddd, MMMM d",
|
||||
"label": "Full Day & Month"
|
||||
}];
|
||||
const match = presets.find((p) => {
|
||||
return p.format === SettingsData.lockDateFormat;
|
||||
});
|
||||
return match ? match.label : "Custom: " + SettingsData.lockDateFormat;
|
||||
"format": "ddd d",
|
||||
"label": "Day Date"
|
||||
}, {
|
||||
"format": "ddd MMM d",
|
||||
"label": "Day Month Date"
|
||||
}, {
|
||||
"format": "MMM d",
|
||||
"label": "Month Date"
|
||||
}, {
|
||||
"format": "M/d",
|
||||
"label": "Numeric (M/D)"
|
||||
}, {
|
||||
"format": "d/M",
|
||||
"label": "Numeric (D/M)"
|
||||
}, {
|
||||
"format": "ddd d MMM yyyy",
|
||||
"label": "Full with Year"
|
||||
}, {
|
||||
"format": "yyyy-MM-dd",
|
||||
"label": "ISO Date"
|
||||
}, {
|
||||
"format": "dddd, MMMM d",
|
||||
"label": "Full Day & Month"
|
||||
}]
|
||||
const match = presets.find(p => {
|
||||
return p.format
|
||||
=== SettingsData.lockDateFormat
|
||||
})
|
||||
return match ? match.label : "Custom: " + SettingsData.lockDateFormat
|
||||
}
|
||||
options: ["Day Date", "Day Month Date", "Month Date", "Numeric (M/D)", "Numeric (D/M)", "Full with Year", "ISO Date", "Full Day & Month", "Custom..."]
|
||||
onValueChanged: (value) => {
|
||||
const formatMap = {
|
||||
"Day Date": "ddd d",
|
||||
"Day Month Date": "ddd MMM d",
|
||||
"Month Date": "MMM d",
|
||||
"Numeric (M/D)": "M/d",
|
||||
"Numeric (D/M)": "d/M",
|
||||
"Full with Year": "ddd d MMM yyyy",
|
||||
"ISO Date": "yyyy-MM-dd",
|
||||
"Full Day & Month": "dddd, MMMM d"
|
||||
};
|
||||
if (value === "Custom...") {
|
||||
customLockFormatInput.visible = true;
|
||||
} else {
|
||||
customLockFormatInput.visible = false;
|
||||
SettingsData.setLockDateFormat(formatMap[value]);
|
||||
}
|
||||
}
|
||||
onValueChanged: value => {
|
||||
const formatMap = {
|
||||
"Day Date": "ddd d",
|
||||
"Day Month Date": "ddd MMM d",
|
||||
"Month Date": "MMM d",
|
||||
"Numeric (M/D)": "M/d",
|
||||
"Numeric (D/M)": "d/M",
|
||||
"Full with Year": "ddd d MMM yyyy",
|
||||
"ISO Date": "yyyy-MM-dd",
|
||||
"Full Day & Month": "dddd, MMMM d"
|
||||
}
|
||||
if (value === "Custom...") {
|
||||
customLockFormatInput.visible = true
|
||||
} else {
|
||||
customLockFormatInput.visible = false
|
||||
SettingsData.setLockDateFormat(
|
||||
formatMap[value])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DankTextField {
|
||||
@@ -246,8 +255,7 @@ Item {
|
||||
text: SettingsData.clockDateFormat
|
||||
onTextChanged: {
|
||||
if (visible && text)
|
||||
SettingsData.setClockDateFormat(text);
|
||||
|
||||
SettingsData.setClockDateFormat(text)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -260,8 +268,7 @@ Item {
|
||||
text: SettingsData.lockDateFormat
|
||||
onTextChanged: {
|
||||
if (visible && text)
|
||||
SettingsData.setLockDateFormat(text);
|
||||
|
||||
SettingsData.setLockDateFormat(text)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,8 +276,11 @@ Item {
|
||||
width: parent.width
|
||||
height: formatHelp.implicitHeight + Theme.spacingM * 2
|
||||
radius: Theme.cornerRadius
|
||||
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.2)
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.1)
|
||||
color: Qt.rgba(Theme.surfaceVariant.r,
|
||||
Theme.surfaceVariant.g,
|
||||
Theme.surfaceVariant.b, 0.2)
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
||||
Theme.outline.b, 0.1)
|
||||
border.width: 1
|
||||
|
||||
Column {
|
||||
@@ -324,7 +334,6 @@ Item {
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceVariantText
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Column {
|
||||
@@ -360,21 +369,12 @@ Item {
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceVariantText
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user