mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-09 23:15:38 -05:00
subtle update
This commit is contained in:
@@ -238,16 +238,56 @@ Row {
|
|||||||
height: 80
|
height: 80
|
||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
color: {
|
color: {
|
||||||
if (gpuCardMouseArea.containsMouse
|
if (!SysMonitorService.availableGpus || SysMonitorService.availableGpus.length === 0) {
|
||||||
&& SysMonitorService.availableGpus.length > 1)
|
if (gpuCardMouseArea.containsMouse && SysMonitorService.availableGpus.length > 1)
|
||||||
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
|
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.16)
|
||||||
Theme.surfaceVariant.b, 0.16)
|
else
|
||||||
|
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.08)
|
||||||
|
}
|
||||||
|
|
||||||
|
var gpu = SysMonitorService.availableGpus[Math.min(SessionData.selectedGpuIndex, SysMonitorService.availableGpus.length - 1)]
|
||||||
|
var vendor = gpu.vendor.toLowerCase()
|
||||||
|
|
||||||
|
if (vendor.includes("nvidia")) {
|
||||||
|
if (gpuCardMouseArea.containsMouse && SysMonitorService.availableGpus.length > 1)
|
||||||
|
return Qt.rgba(Theme.success.r, Theme.success.g, Theme.success.b, 0.2)
|
||||||
|
else
|
||||||
|
return Qt.rgba(Theme.success.r, Theme.success.g, Theme.success.b, 0.12)
|
||||||
|
} else if (vendor.includes("amd")) {
|
||||||
|
if (gpuCardMouseArea.containsMouse && SysMonitorService.availableGpus.length > 1)
|
||||||
|
return Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.2)
|
||||||
|
else
|
||||||
|
return Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.12)
|
||||||
|
} else if (vendor.includes("intel")) {
|
||||||
|
if (gpuCardMouseArea.containsMouse && SysMonitorService.availableGpus.length > 1)
|
||||||
|
return Qt.rgba(Theme.info.r, Theme.info.g, Theme.info.b, 0.2)
|
||||||
|
else
|
||||||
|
return Qt.rgba(Theme.info.r, Theme.info.g, Theme.info.b, 0.12)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gpuCardMouseArea.containsMouse && SysMonitorService.availableGpus.length > 1)
|
||||||
|
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.16)
|
||||||
else
|
else
|
||||||
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
|
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.08)
|
||||||
Theme.surfaceVariant.b, 0.08)
|
}
|
||||||
|
border.color: {
|
||||||
|
if (!SysMonitorService.availableGpus || SysMonitorService.availableGpus.length === 0) {
|
||||||
|
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.2)
|
||||||
|
}
|
||||||
|
|
||||||
|
var gpu = SysMonitorService.availableGpus[Math.min(SessionData.selectedGpuIndex, SysMonitorService.availableGpus.length - 1)]
|
||||||
|
var vendor = gpu.vendor.toLowerCase()
|
||||||
|
|
||||||
|
if (vendor.includes("nvidia")) {
|
||||||
|
return Qt.rgba(Theme.success.r, Theme.success.g, Theme.success.b, 0.3)
|
||||||
|
} else if (vendor.includes("amd")) {
|
||||||
|
return Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.3)
|
||||||
|
} else if (vendor.includes("intel")) {
|
||||||
|
return Qt.rgba(Theme.info.r, Theme.info.g, Theme.info.b, 0.3)
|
||||||
|
}
|
||||||
|
|
||||||
|
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.2)
|
||||||
}
|
}
|
||||||
border.color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
|
|
||||||
Theme.surfaceVariant.b, 0.2)
|
|
||||||
border.width: 1
|
border.width: 1
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
|||||||
@@ -199,19 +199,60 @@ ScrollView {
|
|||||||
height: gpuColumn.implicitHeight + Theme.spacingL
|
height: gpuColumn.implicitHeight + Theme.spacingL
|
||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
color: {
|
color: {
|
||||||
if (gpuCardMouseArea.containsMouse
|
var baseColor = Qt.rgba(Theme.surfaceContainerHigh.r,
|
||||||
&& SysMonitorService.availableGpus.length > 1)
|
Theme.surfaceContainerHigh.g,
|
||||||
return Qt.rgba(Theme.surfaceContainerHigh.r,
|
Theme.surfaceContainerHigh.b, 0.4)
|
||||||
Theme.surfaceContainerHigh.g,
|
var hoverColor = Qt.rgba(Theme.surfaceContainerHigh.r,
|
||||||
Theme.surfaceContainerHigh.b, 0.6)
|
Theme.surfaceContainerHigh.g,
|
||||||
else
|
Theme.surfaceContainerHigh.b, 0.6)
|
||||||
return Qt.rgba(Theme.surfaceContainerHigh.r,
|
|
||||||
Theme.surfaceContainerHigh.g,
|
if (!SysMonitorService.availableGpus || SysMonitorService.availableGpus.length === 0) {
|
||||||
Theme.surfaceContainerHigh.b, 0.4)
|
return gpuCardMouseArea.containsMouse && SysMonitorService.availableGpus.length > 1 ? hoverColor : baseColor
|
||||||
|
}
|
||||||
|
|
||||||
|
var gpu = SysMonitorService.availableGpus[Math.min(SessionData.selectedGpuIndex, SysMonitorService.availableGpus.length - 1)]
|
||||||
|
var vendor = gpu.fullName.split(' ')[0].toLowerCase()
|
||||||
|
var tintColor
|
||||||
|
|
||||||
|
if (vendor.includes("nvidia")) {
|
||||||
|
tintColor = Theme.success
|
||||||
|
} else if (vendor.includes("amd")) {
|
||||||
|
tintColor = Theme.error
|
||||||
|
} else if (vendor.includes("intel")) {
|
||||||
|
tintColor = Theme.info
|
||||||
|
} else {
|
||||||
|
return gpuCardMouseArea.containsMouse && SysMonitorService.availableGpus.length > 1 ? hoverColor : baseColor
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gpuCardMouseArea.containsMouse && SysMonitorService.availableGpus.length > 1) {
|
||||||
|
return Qt.rgba((hoverColor.r + tintColor.r * 0.1) / 1.1,
|
||||||
|
(hoverColor.g + tintColor.g * 0.1) / 1.1,
|
||||||
|
(hoverColor.b + tintColor.b * 0.1) / 1.1, 0.6)
|
||||||
|
} else {
|
||||||
|
return Qt.rgba((baseColor.r + tintColor.r * 0.08) / 1.08,
|
||||||
|
(baseColor.g + tintColor.g * 0.08) / 1.08,
|
||||||
|
(baseColor.b + tintColor.b * 0.08) / 1.08, 0.4)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
border.width: 1
|
border.width: 1
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
border.color: {
|
||||||
Theme.outline.b, 0.1)
|
if (!SysMonitorService.availableGpus || SysMonitorService.availableGpus.length === 0) {
|
||||||
|
return Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.1)
|
||||||
|
}
|
||||||
|
|
||||||
|
var gpu = SysMonitorService.availableGpus[Math.min(SessionData.selectedGpuIndex, SysMonitorService.availableGpus.length - 1)]
|
||||||
|
var vendor = gpu.fullName.split(' ')[0].toLowerCase()
|
||||||
|
|
||||||
|
if (vendor.includes("nvidia")) {
|
||||||
|
return Qt.rgba(Theme.success.r, Theme.success.g, Theme.success.b, 0.3)
|
||||||
|
} else if (vendor.includes("amd")) {
|
||||||
|
return Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.3)
|
||||||
|
} else if (vendor.includes("intel")) {
|
||||||
|
return Qt.rgba(Theme.info.r, Theme.info.g, Theme.info.b, 0.3)
|
||||||
|
}
|
||||||
|
|
||||||
|
return Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.1)
|
||||||
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: gpuCardMouseArea
|
id: gpuCardMouseArea
|
||||||
@@ -284,21 +325,13 @@ ScrollView {
|
|||||||
text: {
|
text: {
|
||||||
if (!SysMonitorService.availableGpus
|
if (!SysMonitorService.availableGpus
|
||||||
|| SysMonitorService.availableGpus.length === 0) {
|
|| SysMonitorService.availableGpus.length === 0) {
|
||||||
return "Nadda"
|
return "Device: N/A"
|
||||||
}
|
}
|
||||||
var gpu = SysMonitorService.availableGpus[Math.min(
|
var gpu = SysMonitorService.availableGpus[Math.min(
|
||||||
SessionData.selectedGpuIndex,
|
SessionData.selectedGpuIndex,
|
||||||
SysMonitorService.availableGpus.length
|
SysMonitorService.availableGpus.length
|
||||||
- 1)]
|
- 1)]
|
||||||
var vendor = gpu.vendor.toLowerCase()
|
return "Device: " + gpu.pciId
|
||||||
if (vendor.includes("nvidia")) {
|
|
||||||
return "<font color='" + Theme.success + "'>The green company</font>"
|
|
||||||
} else if (vendor.includes("amd")) {
|
|
||||||
return "<font color='" + Theme.error + "'>The red company</font>"
|
|
||||||
} else if (vendor.includes("intel")) {
|
|
||||||
return "<font color='" + Theme.info + "'>The blue company</font>"
|
|
||||||
}
|
|
||||||
return gpu.vendor
|
|
||||||
}
|
}
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
font.family: SettingsData.monoFontFamily
|
font.family: SettingsData.monoFontFamily
|
||||||
|
|||||||
@@ -209,11 +209,18 @@ Singleton {
|
|||||||
if (data.gpus) {
|
if (data.gpus) {
|
||||||
const gpuList = []
|
const gpuList = []
|
||||||
for (const gpu of data.gpus) {
|
for (const gpu of data.gpus) {
|
||||||
// Parse the display name from rawLine
|
// Parse the display name and PCI ID from rawLine
|
||||||
let displayName = ""
|
let displayName = ""
|
||||||
let fullName = ""
|
let fullName = ""
|
||||||
|
let pciId = ""
|
||||||
|
|
||||||
if (gpu.rawLine) {
|
if (gpu.rawLine) {
|
||||||
|
// Extract PCI ID [vvvv:dddd]
|
||||||
|
const pciMatch = gpu.rawLine.match(/\[([0-9a-f]{4}:[0-9a-f]{4})\]/i)
|
||||||
|
if (pciMatch) {
|
||||||
|
pciId = pciMatch[1]
|
||||||
|
}
|
||||||
|
|
||||||
// Remove BDF and class prefix
|
// Remove BDF and class prefix
|
||||||
let s = gpu.rawLine.replace(/^[^:]+: /, "")
|
let s = gpu.rawLine.replace(/^[^:]+: /, "")
|
||||||
// Remove PCI ID [vvvv:dddd] and everything after
|
// Remove PCI ID [vvvv:dddd] and everything after
|
||||||
@@ -237,7 +244,6 @@ Singleton {
|
|||||||
displayName = displayName
|
displayName = displayName
|
||||||
.replace(/^NVIDIA Corporation\s+/i, "")
|
.replace(/^NVIDIA Corporation\s+/i, "")
|
||||||
.replace(/^NVIDIA\s+/i, "")
|
.replace(/^NVIDIA\s+/i, "")
|
||||||
.replace(/^GeForce\s+/i, "")
|
|
||||||
.replace(/^Advanced Micro Devices, Inc\.\s+/i, "")
|
.replace(/^Advanced Micro Devices, Inc\.\s+/i, "")
|
||||||
.replace(/^AMD\/ATI\s+/i, "")
|
.replace(/^AMD\/ATI\s+/i, "")
|
||||||
.replace(/^AMD\s+/i, "")
|
.replace(/^AMD\s+/i, "")
|
||||||
@@ -265,6 +271,7 @@ Singleton {
|
|||||||
"vendor": gpu.vendor,
|
"vendor": gpu.vendor,
|
||||||
"displayName": displayName,
|
"displayName": displayName,
|
||||||
"fullName": fullName,
|
"fullName": fullName,
|
||||||
|
"pciId": pciId,
|
||||||
"temperature": 0,
|
"temperature": 0,
|
||||||
"hwmon": "unknown"
|
"hwmon": "unknown"
|
||||||
})
|
})
|
||||||
@@ -291,6 +298,7 @@ Singleton {
|
|||||||
"vendor": gpu.vendor,
|
"vendor": gpu.vendor,
|
||||||
"displayName": gpu.displayName,
|
"displayName": gpu.displayName,
|
||||||
"fullName": gpu.fullName,
|
"fullName": gpu.fullName,
|
||||||
|
"pciId": gpu.pciId,
|
||||||
"temperature": tempInfo.temperature || 0,
|
"temperature": tempInfo.temperature || 0,
|
||||||
"hwmon": tempInfo.hwmon || "unknown"
|
"hwmon": tempInfo.hwmon || "unknown"
|
||||||
})
|
})
|
||||||
@@ -300,6 +308,7 @@ Singleton {
|
|||||||
"vendor": gpu.vendor,
|
"vendor": gpu.vendor,
|
||||||
"displayName": gpu.displayName,
|
"displayName": gpu.displayName,
|
||||||
"fullName": gpu.fullName,
|
"fullName": gpu.fullName,
|
||||||
|
"pciId": gpu.pciId,
|
||||||
"temperature": gpu.temperature || 0,
|
"temperature": gpu.temperature || 0,
|
||||||
"hwmon": gpu.hwmon || "unknown"
|
"hwmon": gpu.hwmon || "unknown"
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user