mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-06 05:25:41 -05:00
Allow solid colored wallpaper, fix fzf search
This commit is contained in:
@@ -18,56 +18,58 @@ Item {
|
||||
property bool fontsEnumerated: false
|
||||
|
||||
function enumerateFonts() {
|
||||
var fonts = ["Default"];
|
||||
var availableFonts = Qt.fontFamilies();
|
||||
var rootFamilies = [];
|
||||
var seenFamilies = new Set();
|
||||
var fonts = ["Default"]
|
||||
var availableFonts = Qt.fontFamilies()
|
||||
var rootFamilies = []
|
||||
var seenFamilies = new Set()
|
||||
for (var i = 0; i < availableFonts.length; i++) {
|
||||
var fontName = availableFonts[i];
|
||||
var fontName = availableFonts[i]
|
||||
if (fontName.startsWith("."))
|
||||
continue;
|
||||
continue
|
||||
|
||||
if (fontName === SettingsData.defaultFontFamily)
|
||||
continue;
|
||||
continue
|
||||
|
||||
var rootName = fontName.replace(/ (Thin|Extra Light|Light|Regular|Medium|Semi Bold|Demi Bold|Bold|Extra Bold|Black|Heavy)$/i, "").replace(/ (Italic|Oblique|Condensed|Extended|Narrow|Wide)$/i, "").replace(/ (UI|Display|Text|Mono|Sans|Serif)$/i, function(match, suffix) {
|
||||
return match;
|
||||
}).trim();
|
||||
var rootName = fontName.replace(/ (Thin|Extra Light|Light|Regular|Medium|Semi Bold|Demi Bold|Bold|Extra Bold|Black|Heavy)$/i, "").replace(/ (Italic|Oblique|Condensed|Extended|Narrow|Wide)$/i,
|
||||
"").replace(/ (UI|Display|Text|Mono|Sans|Serif)$/i, function (match, suffix) {
|
||||
return match
|
||||
}).trim()
|
||||
if (!seenFamilies.has(rootName) && rootName !== "") {
|
||||
seenFamilies.add(rootName);
|
||||
rootFamilies.push(rootName);
|
||||
seenFamilies.add(rootName)
|
||||
rootFamilies.push(rootName)
|
||||
}
|
||||
}
|
||||
cachedFontFamilies = fonts.concat(rootFamilies.sort());
|
||||
var monoFonts = ["Default"];
|
||||
var monoFamilies = [];
|
||||
var seenMonoFamilies = new Set();
|
||||
cachedFontFamilies = fonts.concat(rootFamilies.sort())
|
||||
var monoFonts = ["Default"]
|
||||
var monoFamilies = []
|
||||
var seenMonoFamilies = new Set()
|
||||
for (var j = 0; j < availableFonts.length; j++) {
|
||||
var fontName2 = availableFonts[j];
|
||||
var fontName2 = availableFonts[j]
|
||||
if (fontName2.startsWith("."))
|
||||
continue;
|
||||
continue
|
||||
|
||||
if (fontName2 === SettingsData.defaultMonoFontFamily)
|
||||
continue;
|
||||
continue
|
||||
|
||||
var lowerName = fontName2.toLowerCase();
|
||||
if (lowerName.includes("mono") || lowerName.includes("code") || lowerName.includes("console") || lowerName.includes("terminal") || lowerName.includes("courier") || lowerName.includes("dejavu sans mono") || lowerName.includes("jetbrains") || lowerName.includes("fira") || lowerName.includes("hack") || lowerName.includes("source code") || lowerName.includes("ubuntu mono") || lowerName.includes("cascadia")) {
|
||||
var rootName2 = fontName2.replace(/ (Thin|Extra Light|Light|Regular|Medium|Semi Bold|Demi Bold|Bold|Extra Bold|Black|Heavy)$/i, "").replace(/ (Italic|Oblique|Condensed|Extended|Narrow|Wide)$/i, "").trim();
|
||||
var lowerName = fontName2.toLowerCase()
|
||||
if (lowerName.includes("mono") || lowerName.includes("code") || lowerName.includes("console") || lowerName.includes("terminal") || lowerName.includes("courier") || lowerName.includes("dejavu sans mono") || lowerName.includes(
|
||||
"jetbrains") || lowerName.includes("fira") || lowerName.includes("hack") || lowerName.includes("source code") || lowerName.includes("ubuntu mono") || lowerName.includes("cascadia")) {
|
||||
var rootName2 = fontName2.replace(/ (Thin|Extra Light|Light|Regular|Medium|Semi Bold|Demi Bold|Bold|Extra Bold|Black|Heavy)$/i, "").replace(/ (Italic|Oblique|Condensed|Extended|Narrow|Wide)$/i, "").trim()
|
||||
if (!seenMonoFamilies.has(rootName2) && rootName2 !== "") {
|
||||
seenMonoFamilies.add(rootName2);
|
||||
monoFamilies.push(rootName2);
|
||||
seenMonoFamilies.add(rootName2)
|
||||
monoFamilies.push(rootName2)
|
||||
}
|
||||
}
|
||||
}
|
||||
cachedMonoFamilies = monoFonts.concat(monoFamilies.sort());
|
||||
cachedMonoFamilies = monoFonts.concat(monoFamilies.sort())
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
// Access WallpaperCyclingService to ensure it's initialized
|
||||
WallpaperCyclingService.cyclingActive;
|
||||
WallpaperCyclingService.cyclingActive
|
||||
if (!fontsEnumerated) {
|
||||
enumerateFonts();
|
||||
fontsEnumerated = true;
|
||||
enumerateFonts()
|
||||
fontsEnumerated = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +120,6 @@ Item {
|
||||
color: Theme.surfaceText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Row {
|
||||
@@ -136,9 +137,9 @@ Item {
|
||||
CachingImage {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 1
|
||||
source: SessionData.wallpaperPath !== "" ? "file://" + SessionData.wallpaperPath : ""
|
||||
source: (SessionData.wallpaperPath !== "" && !SessionData.wallpaperPath.startsWith("#")) ? "file://" + SessionData.wallpaperPath : ""
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
visible: SessionData.wallpaperPath !== ""
|
||||
visible: SessionData.wallpaperPath !== "" && !SessionData.wallpaperPath.startsWith("#")
|
||||
maxCacheSize: 160
|
||||
layer.enabled: true
|
||||
|
||||
@@ -148,7 +149,14 @@ Item {
|
||||
maskThresholdMin: 0.5
|
||||
maskSpreadAtMin: 1
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 1
|
||||
radius: Theme.cornerRadius - 1
|
||||
color: SessionData.wallpaperPath.startsWith("#") ? SessionData.wallpaperPath : "transparent"
|
||||
visible: SessionData.wallpaperPath !== "" && SessionData.wallpaperPath.startsWith("#")
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
@@ -199,13 +207,34 @@ Item {
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
if (parentModal) {
|
||||
parentModal.allowFocusOverride = true;
|
||||
parentModal.shouldHaveFocus = false;
|
||||
parentModal.allowFocusOverride = true
|
||||
parentModal.shouldHaveFocus = false
|
||||
}
|
||||
wallpaperBrowser.open();
|
||||
wallpaperBrowser.open()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: 32
|
||||
height: 32
|
||||
radius: 16
|
||||
color: Qt.rgba(255, 255, 255, 0.9)
|
||||
|
||||
DankIcon {
|
||||
anchors.centerIn: parent
|
||||
name: "palette"
|
||||
size: 18
|
||||
color: "black"
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
colorPicker.open()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
@@ -227,16 +256,13 @@ Item {
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
if (Theme.currentTheme === Theme.dynamic)
|
||||
Theme.switchTheme("blue");
|
||||
Theme.switchTheme("blue")
|
||||
|
||||
SessionData.setWallpaper("");
|
||||
SessionData.clearWallpaper()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
@@ -248,7 +274,6 @@ Item {
|
||||
propagateComposedEvents: true
|
||||
acceptedButtons: Qt.NoButton
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Column {
|
||||
@@ -283,12 +308,12 @@ Item {
|
||||
buttonSize: 32
|
||||
iconName: "skip_previous"
|
||||
iconSize: Theme.iconSizeSmall
|
||||
enabled: SessionData.wallpaperPath
|
||||
opacity: SessionData.wallpaperPath ? 1 : 0.5
|
||||
enabled: SessionData.wallpaperPath && !SessionData.wallpaperPath.startsWith("#")
|
||||
opacity: (SessionData.wallpaperPath && !SessionData.wallpaperPath.startsWith("#")) ? 1 : 0.5
|
||||
backgroundColor: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.5)
|
||||
iconColor: Theme.surfaceText
|
||||
onClicked: {
|
||||
WallpaperCyclingService.cyclePrevManually();
|
||||
WallpaperCyclingService.cyclePrevManually()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -296,19 +321,16 @@ Item {
|
||||
buttonSize: 32
|
||||
iconName: "skip_next"
|
||||
iconSize: Theme.iconSizeSmall
|
||||
enabled: SessionData.wallpaperPath
|
||||
opacity: SessionData.wallpaperPath ? 1 : 0.5
|
||||
enabled: SessionData.wallpaperPath && !SessionData.wallpaperPath.startsWith("#")
|
||||
opacity: (SessionData.wallpaperPath && !SessionData.wallpaperPath.startsWith("#")) ? 1 : 0.5
|
||||
backgroundColor: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.5)
|
||||
iconColor: Theme.surfaceText
|
||||
onClicked: {
|
||||
WallpaperCyclingService.cycleNextManually();
|
||||
WallpaperCyclingService.cycleNextManually()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Wallpaper Cycling Section - Full Width
|
||||
@@ -354,7 +376,6 @@ Item {
|
||||
color: Theme.surfaceVariantText
|
||||
width: parent.width
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
DankToggle {
|
||||
@@ -362,11 +383,10 @@ Item {
|
||||
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: SessionData.wallpaperCyclingEnabled
|
||||
onToggled: (toggled) => {
|
||||
return SessionData.setWallpaperCyclingEnabled(toggled);
|
||||
}
|
||||
onToggled: toggled => {
|
||||
return SessionData.setWallpaperCyclingEnabled(toggled)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Cycling mode and settings
|
||||
@@ -393,18 +413,17 @@ Item {
|
||||
width: 200
|
||||
height: 32
|
||||
model: [{
|
||||
"text": "Interval",
|
||||
"icon": "schedule"
|
||||
}, {
|
||||
"text": "Time",
|
||||
"icon": "access_time"
|
||||
}]
|
||||
"text": "Interval",
|
||||
"icon": "schedule"
|
||||
}, {
|
||||
"text": "Time",
|
||||
"icon": "access_time"
|
||||
}]
|
||||
currentIndex: SessionData.wallpaperCyclingMode === "time" ? 1 : 0
|
||||
onTabClicked: (index) => {
|
||||
SessionData.setWallpaperCyclingMode(index === 1 ? "time" : "interval");
|
||||
}
|
||||
onTabClicked: index => {
|
||||
SessionData.setWallpaperCyclingMode(index === 1 ? "time" : "interval")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Interval settings
|
||||
@@ -418,16 +437,15 @@ Item {
|
||||
description: "How often to change wallpaper"
|
||||
options: intervalOptions
|
||||
currentValue: {
|
||||
const currentSeconds = SessionData.wallpaperCyclingInterval;
|
||||
const index = intervalValues.indexOf(currentSeconds);
|
||||
return index >= 0 ? intervalOptions[index] : "5 minutes";
|
||||
}
|
||||
onValueChanged: (value) => {
|
||||
const index = intervalOptions.indexOf(value);
|
||||
if (index >= 0)
|
||||
SessionData.setWallpaperCyclingInterval(intervalValues[index]);
|
||||
|
||||
const currentSeconds = SessionData.wallpaperCyclingInterval
|
||||
const index = intervalValues.indexOf(currentSeconds)
|
||||
return index >= 0 ? intervalOptions[index] : "5 minutes"
|
||||
}
|
||||
onValueChanged: value => {
|
||||
const index = intervalOptions.indexOf(value)
|
||||
if (index >= 0)
|
||||
SessionData.setWallpaperCyclingInterval(intervalValues[index])
|
||||
}
|
||||
}
|
||||
|
||||
// Time settings
|
||||
@@ -452,25 +470,24 @@ Item {
|
||||
topPadding: Theme.spacingS
|
||||
bottomPadding: Theme.spacingS
|
||||
onAccepted: {
|
||||
var isValid = /^([0-1][0-9]|2[0-3]):[0-5][0-9]$/.test(text);
|
||||
var isValid = /^([0-1][0-9]|2[0-3]):[0-5][0-9]$/.test(text)
|
||||
if (isValid)
|
||||
SessionData.setWallpaperCyclingTime(text);
|
||||
SessionData.setWallpaperCyclingTime(text)
|
||||
else
|
||||
text = SessionData.wallpaperCyclingTime;
|
||||
text = SessionData.wallpaperCyclingTime
|
||||
}
|
||||
onEditingFinished: {
|
||||
var isValid = /^([0-1][0-9]|2[0-3]):[0-5][0-9]$/.test(text);
|
||||
var isValid = /^([0-1][0-9]|2[0-3]):[0-5][0-9]$/.test(text)
|
||||
if (isValid)
|
||||
SessionData.setWallpaperCyclingTime(text);
|
||||
SessionData.setWallpaperCyclingTime(text)
|
||||
else
|
||||
text = SessionData.wallpaperCyclingTime;
|
||||
text = SessionData.wallpaperCyclingTime
|
||||
}
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
validator: RegularExpressionValidator {
|
||||
regularExpression: /^([0-1][0-9]|2[0-3]):[0-5][0-9]$/
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
StyledText {
|
||||
@@ -479,15 +496,10 @@ Item {
|
||||
color: Theme.surfaceVariantText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Dynamic Theme Section
|
||||
@@ -536,7 +548,6 @@ Item {
|
||||
wrapMode: Text.WordWrap
|
||||
width: parent.width
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
DankToggle {
|
||||
@@ -545,14 +556,13 @@ Item {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: Theme.wallpaperPath !== "" && Theme.currentTheme === Theme.dynamic
|
||||
enabled: ToastService.wallpaperErrorStatus !== "matugen_missing" && Theme.wallpaperPath !== ""
|
||||
onToggled: (toggled) => {
|
||||
if (toggled)
|
||||
Theme.switchTheme(Theme.dynamic);
|
||||
else
|
||||
Theme.switchTheme("blue");
|
||||
}
|
||||
onToggled: toggled => {
|
||||
if (toggled)
|
||||
Theme.switchTheme(Theme.dynamic)
|
||||
else
|
||||
Theme.switchTheme("blue")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
StyledText {
|
||||
@@ -563,9 +573,7 @@ Item {
|
||||
width: parent.width
|
||||
leftPadding: Theme.iconSize + Theme.spacingM
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Display Settings
|
||||
@@ -602,7 +610,6 @@ Item {
|
||||
color: Theme.surfaceText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
DankToggle {
|
||||
@@ -610,9 +617,9 @@ Item {
|
||||
text: "Light Mode"
|
||||
description: "Use light theme instead of dark theme"
|
||||
checked: SessionData.isLightMode
|
||||
onToggled: (checked) => {
|
||||
Theme.setLightMode(checked);
|
||||
}
|
||||
onToggled: checked => {
|
||||
Theme.setLightMode(checked)
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
@@ -629,13 +636,13 @@ Item {
|
||||
text: "Night Mode"
|
||||
description: "Apply warm color temperature to reduce eye strain. Use automation settings below to control when it activates."
|
||||
checked: DisplayService.nightModeEnabled
|
||||
onToggled: (checked) => {
|
||||
DisplayService.toggleNightMode();
|
||||
}
|
||||
onToggled: checked => {
|
||||
DisplayService.toggleNightMode()
|
||||
}
|
||||
|
||||
Connections {
|
||||
function onNightModeEnabledChanged() {
|
||||
nightModeToggle.checked = DisplayService.nightModeEnabled;
|
||||
nightModeToggle.checked = DisplayService.nightModeEnabled
|
||||
}
|
||||
|
||||
target: DisplayService
|
||||
@@ -648,16 +655,16 @@ Item {
|
||||
description: "Color temperature for night mode"
|
||||
currentValue: SessionData.nightModeTemperature + "K"
|
||||
options: {
|
||||
var temps = [];
|
||||
var temps = []
|
||||
for (var i = 2500; i <= 6000; i += 500) {
|
||||
temps.push(i + "K");
|
||||
temps.push(i + "K")
|
||||
}
|
||||
return temps;
|
||||
}
|
||||
onValueChanged: (value) => {
|
||||
var temp = parseInt(value.replace("K", ""));
|
||||
SessionData.setNightModeTemperature(temp);
|
||||
return temps
|
||||
}
|
||||
onValueChanged: value => {
|
||||
var temp = parseInt(value.replace("K", ""))
|
||||
SessionData.setNightModeTemperature(temp)
|
||||
}
|
||||
}
|
||||
|
||||
DankToggle {
|
||||
@@ -666,19 +673,19 @@ Item {
|
||||
text: "Automatic Control"
|
||||
description: "Only adjust gamma based on time or location rules."
|
||||
checked: SessionData.nightModeAutoEnabled
|
||||
onToggled: (checked) => {
|
||||
if (checked && !DisplayService.nightModeEnabled) {
|
||||
DisplayService.toggleNightMode();
|
||||
} else if (!checked && DisplayService.nightModeEnabled) {
|
||||
DisplayService.toggleNightMode();
|
||||
}
|
||||
SessionData.setNightModeAutoEnabled(checked);
|
||||
}
|
||||
onToggled: checked => {
|
||||
if (checked && !DisplayService.nightModeEnabled) {
|
||||
DisplayService.toggleNightMode()
|
||||
} else if (!checked && DisplayService.nightModeEnabled) {
|
||||
DisplayService.toggleNightMode()
|
||||
}
|
||||
SessionData.setNightModeAutoEnabled(checked)
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: SessionData
|
||||
function onNightModeAutoEnabledChanged() {
|
||||
automaticToggle.checked = SessionData.nightModeAutoEnabled;
|
||||
automaticToggle.checked = SessionData.nightModeAutoEnabled
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -693,7 +700,7 @@ Item {
|
||||
Connections {
|
||||
target: SessionData
|
||||
function onNightModeAutoEnabledChanged() {
|
||||
automaticSettings.visible = SessionData.nightModeAutoEnabled;
|
||||
automaticSettings.visible = SessionData.nightModeAutoEnabled
|
||||
}
|
||||
}
|
||||
|
||||
@@ -702,22 +709,22 @@ Item {
|
||||
width: 200
|
||||
height: 32
|
||||
model: [{
|
||||
"text": "Time",
|
||||
"icon": "access_time"
|
||||
}, {
|
||||
"text": "Location",
|
||||
"icon": "place"
|
||||
}]
|
||||
|
||||
"text": "Time",
|
||||
"icon": "access_time"
|
||||
}, {
|
||||
"text": "Location",
|
||||
"icon": "place"
|
||||
}]
|
||||
|
||||
Component.onCompleted: {
|
||||
currentIndex = SessionData.nightModeAutoMode === "location" ? 1 : 0;
|
||||
}
|
||||
|
||||
onTabClicked: (index) => {
|
||||
console.log("Tab clicked:", index, "Setting mode to:", index === 1 ? "location" : "time");
|
||||
DisplayService.setNightModeAutomationMode(index === 1 ? "location" : "time");
|
||||
currentIndex = index;
|
||||
currentIndex = SessionData.nightModeAutoMode === "location" ? 1 : 0
|
||||
}
|
||||
|
||||
onTabClicked: index => {
|
||||
console.log("Tab clicked:", index, "Setting mode to:", index === 1 ? "location" : "time")
|
||||
DisplayService.setNightModeAutomationMode(index === 1 ? "location" : "time")
|
||||
currentIndex = index
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
@@ -770,15 +777,15 @@ Item {
|
||||
text: ""
|
||||
currentValue: SessionData.nightModeStartHour.toString()
|
||||
options: {
|
||||
var hours = [];
|
||||
var hours = []
|
||||
for (var i = 0; i < 24; i++) {
|
||||
hours.push(i.toString());
|
||||
hours.push(i.toString())
|
||||
}
|
||||
return hours;
|
||||
}
|
||||
onValueChanged: (value) => {
|
||||
SessionData.setNightModeStartHour(parseInt(value));
|
||||
return hours
|
||||
}
|
||||
onValueChanged: value => {
|
||||
SessionData.setNightModeStartHour(parseInt(value))
|
||||
}
|
||||
}
|
||||
|
||||
DankDropdown {
|
||||
@@ -787,15 +794,15 @@ Item {
|
||||
text: ""
|
||||
currentValue: SessionData.nightModeStartMinute.toString().padStart(2, '0')
|
||||
options: {
|
||||
var minutes = [];
|
||||
var minutes = []
|
||||
for (var i = 0; i < 60; i += 5) {
|
||||
minutes.push(i.toString().padStart(2, '0'));
|
||||
minutes.push(i.toString().padStart(2, '0'))
|
||||
}
|
||||
return minutes;
|
||||
}
|
||||
onValueChanged: (value) => {
|
||||
SessionData.setNightModeStartMinute(parseInt(value));
|
||||
return minutes
|
||||
}
|
||||
onValueChanged: value => {
|
||||
SessionData.setNightModeStartMinute(parseInt(value))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -818,15 +825,15 @@ Item {
|
||||
text: ""
|
||||
currentValue: SessionData.nightModeEndHour.toString()
|
||||
options: {
|
||||
var hours = [];
|
||||
var hours = []
|
||||
for (var i = 0; i < 24; i++) {
|
||||
hours.push(i.toString());
|
||||
hours.push(i.toString())
|
||||
}
|
||||
return hours;
|
||||
}
|
||||
onValueChanged: (value) => {
|
||||
SessionData.setNightModeEndHour(parseInt(value));
|
||||
return hours
|
||||
}
|
||||
onValueChanged: value => {
|
||||
SessionData.setNightModeEndHour(parseInt(value))
|
||||
}
|
||||
}
|
||||
|
||||
DankDropdown {
|
||||
@@ -835,15 +842,15 @@ Item {
|
||||
text: ""
|
||||
currentValue: SessionData.nightModeEndMinute.toString().padStart(2, '0')
|
||||
options: {
|
||||
var minutes = [];
|
||||
var minutes = []
|
||||
for (var i = 0; i < 60; i += 5) {
|
||||
minutes.push(i.toString().padStart(2, '0'));
|
||||
minutes.push(i.toString().padStart(2, '0'))
|
||||
}
|
||||
return minutes;
|
||||
}
|
||||
onValueChanged: (value) => {
|
||||
SessionData.setNightModeEndMinute(parseInt(value));
|
||||
return minutes
|
||||
}
|
||||
onValueChanged: value => {
|
||||
SessionData.setNightModeEndMinute(parseInt(value))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -860,15 +867,15 @@ Item {
|
||||
description: DisplayService.geoclueAvailable ? "Use automatic location detection (geoclue2)" : "Geoclue service not running - cannot auto-detect location"
|
||||
checked: SessionData.nightModeLocationProvider === "geoclue2"
|
||||
enabled: DisplayService.geoclueAvailable
|
||||
onToggled: (checked) => {
|
||||
if (checked && DisplayService.geoclueAvailable) {
|
||||
SessionData.setNightModeLocationProvider("geoclue2")
|
||||
SessionData.setLatitude(0.0)
|
||||
SessionData.setLongitude(0.0)
|
||||
} else {
|
||||
SessionData.setNightModeLocationProvider("")
|
||||
}
|
||||
}
|
||||
onToggled: checked => {
|
||||
if (checked && DisplayService.geoclueAvailable) {
|
||||
SessionData.setNightModeLocationProvider("geoclue2")
|
||||
SessionData.setLatitude(0.0)
|
||||
SessionData.setLongitude(0.0)
|
||||
} else {
|
||||
SessionData.setNightModeLocationProvider("")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StyledText {
|
||||
@@ -937,13 +944,8 @@ Item {
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Font Settings
|
||||
@@ -980,7 +982,6 @@ Item {
|
||||
color: Theme.surfaceText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
DankDropdown {
|
||||
@@ -989,20 +990,20 @@ Item {
|
||||
description: "Select system font family"
|
||||
currentValue: {
|
||||
if (SettingsData.fontFamily === SettingsData.defaultFontFamily)
|
||||
return "Default";
|
||||
return "Default"
|
||||
else
|
||||
return SettingsData.fontFamily || "Default";
|
||||
return SettingsData.fontFamily || "Default"
|
||||
}
|
||||
enableFuzzySearch: true
|
||||
popupWidthOffset: 100
|
||||
maxPopupHeight: 400
|
||||
options: cachedFontFamilies
|
||||
onValueChanged: (value) => {
|
||||
if (value.startsWith("Default"))
|
||||
SettingsData.setFontFamily(SettingsData.defaultFontFamily);
|
||||
else
|
||||
SettingsData.setFontFamily(value);
|
||||
}
|
||||
onValueChanged: value => {
|
||||
if (value.startsWith("Default"))
|
||||
SettingsData.setFontFamily(SettingsData.defaultFontFamily)
|
||||
else
|
||||
SettingsData.setFontFamily(value)
|
||||
}
|
||||
}
|
||||
|
||||
DankDropdown {
|
||||
@@ -1012,64 +1013,64 @@ Item {
|
||||
currentValue: {
|
||||
switch (SettingsData.fontWeight) {
|
||||
case Font.Thin:
|
||||
return "Thin";
|
||||
return "Thin"
|
||||
case Font.ExtraLight:
|
||||
return "Extra Light";
|
||||
return "Extra Light"
|
||||
case Font.Light:
|
||||
return "Light";
|
||||
return "Light"
|
||||
case Font.Normal:
|
||||
return "Regular";
|
||||
return "Regular"
|
||||
case Font.Medium:
|
||||
return "Medium";
|
||||
return "Medium"
|
||||
case Font.DemiBold:
|
||||
return "Demi Bold";
|
||||
return "Demi Bold"
|
||||
case Font.Bold:
|
||||
return "Bold";
|
||||
return "Bold"
|
||||
case Font.ExtraBold:
|
||||
return "Extra Bold";
|
||||
return "Extra Bold"
|
||||
case Font.Black:
|
||||
return "Black";
|
||||
return "Black"
|
||||
default:
|
||||
return "Regular";
|
||||
return "Regular"
|
||||
}
|
||||
}
|
||||
options: ["Thin", "Extra Light", "Light", "Regular", "Medium", "Demi Bold", "Bold", "Extra Bold", "Black"]
|
||||
onValueChanged: (value) => {
|
||||
var weight;
|
||||
switch (value) {
|
||||
case "Thin":
|
||||
weight = Font.Thin;
|
||||
break;
|
||||
case "Extra Light":
|
||||
weight = Font.ExtraLight;
|
||||
break;
|
||||
case "Light":
|
||||
weight = Font.Light;
|
||||
break;
|
||||
case "Regular":
|
||||
weight = Font.Normal;
|
||||
break;
|
||||
case "Medium":
|
||||
weight = Font.Medium;
|
||||
break;
|
||||
case "Demi Bold":
|
||||
weight = Font.DemiBold;
|
||||
break;
|
||||
case "Bold":
|
||||
weight = Font.Bold;
|
||||
break;
|
||||
case "Extra Bold":
|
||||
weight = Font.ExtraBold;
|
||||
break;
|
||||
case "Black":
|
||||
weight = Font.Black;
|
||||
break;
|
||||
default:
|
||||
weight = Font.Normal;
|
||||
break;
|
||||
}
|
||||
SettingsData.setFontWeight(weight);
|
||||
}
|
||||
onValueChanged: value => {
|
||||
var weight
|
||||
switch (value) {
|
||||
case "Thin":
|
||||
weight = Font.Thin
|
||||
break
|
||||
case "Extra Light":
|
||||
weight = Font.ExtraLight
|
||||
break
|
||||
case "Light":
|
||||
weight = Font.Light
|
||||
break
|
||||
case "Regular":
|
||||
weight = Font.Normal
|
||||
break
|
||||
case "Medium":
|
||||
weight = Font.Medium
|
||||
break
|
||||
case "Demi Bold":
|
||||
weight = Font.DemiBold
|
||||
break
|
||||
case "Bold":
|
||||
weight = Font.Bold
|
||||
break
|
||||
case "Extra Bold":
|
||||
weight = Font.ExtraBold
|
||||
break
|
||||
case "Black":
|
||||
weight = Font.Black
|
||||
break
|
||||
default:
|
||||
weight = Font.Normal
|
||||
break
|
||||
}
|
||||
SettingsData.setFontWeight(weight)
|
||||
}
|
||||
}
|
||||
|
||||
DankDropdown {
|
||||
@@ -1078,28 +1079,24 @@ Item {
|
||||
description: "Select monospace font for process list and technical displays"
|
||||
currentValue: {
|
||||
if (SettingsData.monoFontFamily === SettingsData.defaultMonoFontFamily)
|
||||
return "Default";
|
||||
return "Default"
|
||||
|
||||
return SettingsData.monoFontFamily || "Default";
|
||||
return SettingsData.monoFontFamily || "Default"
|
||||
}
|
||||
enableFuzzySearch: true
|
||||
popupWidthOffset: 100
|
||||
maxPopupHeight: 400
|
||||
options: cachedMonoFamilies
|
||||
onValueChanged: (value) => {
|
||||
if (value === "Default")
|
||||
SettingsData.setMonoFontFamily(SettingsData.defaultMonoFontFamily);
|
||||
else
|
||||
SettingsData.setMonoFontFamily(value);
|
||||
}
|
||||
onValueChanged: value => {
|
||||
if (value === "Default")
|
||||
SettingsData.setMonoFontFamily(SettingsData.defaultMonoFontFamily)
|
||||
else
|
||||
SettingsData.setMonoFontFamily(value)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
FileBrowserModal {
|
||||
@@ -1109,18 +1106,26 @@ Item {
|
||||
browserIcon: "wallpaper"
|
||||
browserType: "wallpaper"
|
||||
fileExtensions: ["*.jpg", "*.jpeg", "*.png", "*.bmp", "*.gif", "*.webp"]
|
||||
onFileSelected: (path) => {
|
||||
SessionData.setWallpaper(path);
|
||||
close();
|
||||
}
|
||||
onFileSelected: path => {
|
||||
SessionData.setWallpaper(path)
|
||||
close()
|
||||
}
|
||||
onDialogClosed: {
|
||||
if (parentModal) {
|
||||
parentModal.allowFocusOverride = false;
|
||||
parentModal.allowFocusOverride = false
|
||||
parentModal.shouldHaveFocus = Qt.binding(() => {
|
||||
return parentModal.shouldBeVisible;
|
||||
});
|
||||
return parentModal.shouldBeVisible
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DankColorPicker {
|
||||
id: colorPicker
|
||||
|
||||
pickerTitle: "Choose Wallpaper Color"
|
||||
onColorSelected: selectedColor => {
|
||||
SessionData.setWallpaperColor(selectedColor)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user