1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-29 07:52:50 -05:00

settings: various consistency issues fixed

part of #725
This commit is contained in:
bbedward
2025-11-15 12:05:44 -05:00
parent 7e17e7d37a
commit 20f7d60147
15 changed files with 46 additions and 31 deletions

View File

@@ -139,7 +139,7 @@ Rectangle {
} }
StyledText { StyledText {
text: DgopService.distribution || "Linux" text: UserInfoService.hostname || "Linux"
font.pixelSize: Theme.fontSizeMedium font.pixelSize: Theme.fontSizeMedium
color: Theme.surfaceVariantText color: Theme.surfaceVariantText
elide: Text.ElideRight elide: Text.ElideRight

View File

@@ -12,9 +12,9 @@ FocusScope {
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
anchors.leftMargin: 0 anchors.leftMargin: Theme.spacingS
anchors.rightMargin: Theme.spacingS anchors.rightMargin: 0
anchors.bottomMargin: Theme.spacingM anchors.bottomMargin: 0
anchors.topMargin: 0 anchors.topMargin: 0
color: "transparent" color: "transparent"

View File

@@ -66,7 +66,7 @@ Rectangle {
Column { Column {
id: sidebarColumn id: sidebarColumn
width: parent.width anchors.fill: parent
anchors.leftMargin: Theme.spacingS anchors.leftMargin: Theme.spacingS
anchors.rightMargin: Theme.spacingS anchors.rightMargin: Theme.spacingS
anchors.bottomMargin: Theme.spacingS anchors.bottomMargin: Theme.spacingS
@@ -100,7 +100,7 @@ Rectangle {
property bool isActive: sidebarContainer.currentIndex === index property bool isActive: sidebarContainer.currentIndex === index
width: sidebarColumn.width - Theme.spacingS * 2 width: parent.width
height: 44 height: 44
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: isActive ? Theme.primary : tabMouseArea.containsMouse ? Theme.surfaceHover : "transparent" color: isActive ? Theme.primary : tabMouseArea.containsMouse ? Theme.surfaceHover : "transparent"

View File

@@ -9,10 +9,10 @@ DankFlickable {
contentHeight: systemColumn.implicitHeight contentHeight: systemColumn.implicitHeight
clip: true clip: true
Component.onCompleted: { Component.onCompleted: {
DgopService.addRef(["system", "hardware", "diskmounts"]); DgopService.addRef(["system", "diskmounts"]);
} }
Component.onDestruction: { Component.onDestruction: {
DgopService.removeRef(["system", "hardware", "diskmounts"]); DgopService.removeRef(["system", "diskmounts"]);
} }
Column { Column {

View File

@@ -75,7 +75,6 @@ Item {
DankFlickable { DankFlickable {
anchors.fill: parent anchors.fill: parent
anchors.topMargin: Theme.spacingL
clip: true clip: true
contentHeight: mainColumn.height contentHeight: mainColumn.height
contentWidth: width contentWidth: width

View File

@@ -736,8 +736,6 @@ Item {
DankFlickable { DankFlickable {
anchors.fill: parent anchors.fill: parent
anchors.topMargin: Theme.spacingL
anchors.bottomMargin: Theme.spacingS
clip: true clip: true
contentHeight: mainColumn.height contentHeight: mainColumn.height
contentWidth: width contentWidth: width

View File

@@ -75,8 +75,6 @@ Item {
DankFlickable { DankFlickable {
anchors.fill: parent anchors.fill: parent
anchors.topMargin: Theme.spacingL
anchors.bottomMargin: Theme.spacingS
clip: true clip: true
contentHeight: mainColumn.height contentHeight: mainColumn.height
contentWidth: width contentWidth: width

View File

@@ -10,7 +10,6 @@ Item {
DankFlickable { DankFlickable {
anchors.fill: parent anchors.fill: parent
anchors.topMargin: Theme.spacingL
clip: true clip: true
contentHeight: mainColumn.height contentHeight: mainColumn.height
contentWidth: width contentWidth: width

View File

@@ -24,7 +24,6 @@ Item {
DankFlickable { DankFlickable {
anchors.fill: parent anchors.fill: parent
anchors.topMargin: Theme.spacingL
clip: true clip: true
contentHeight: mainColumn.height contentHeight: mainColumn.height
contentWidth: width contentWidth: width

View File

@@ -68,7 +68,6 @@ Item {
DankFlickable { DankFlickable {
anchors.fill: parent anchors.fill: parent
anchors.topMargin: Theme.spacingL
clip: true clip: true
contentHeight: mainColumn.height contentHeight: mainColumn.height
contentWidth: width contentWidth: width

View File

@@ -19,7 +19,6 @@ FocusScope {
DankFlickable { DankFlickable {
anchors.fill: parent anchors.fill: parent
anchors.topMargin: Theme.spacingL
clip: true clip: true
contentHeight: mainColumn.height contentHeight: mainColumn.height
contentWidth: width contentWidth: width

View File

@@ -64,7 +64,6 @@ Item {
DankFlickable { DankFlickable {
anchors.fill: parent anchors.fill: parent
anchors.topMargin: Theme.spacingL
clip: true clip: true
contentHeight: mainColumn.height contentHeight: mainColumn.height
contentWidth: width contentWidth: width

View File

@@ -11,7 +11,6 @@ Item {
DankFlickable { DankFlickable {
anchors.fill: parent anchors.fill: parent
anchors.topMargin: Theme.spacingL
clip: true clip: true
contentHeight: mainColumn.height contentHeight: mainColumn.height
contentWidth: width contentWidth: width

View File

@@ -9,7 +9,6 @@ Item {
DankFlickable { DankFlickable {
anchors.fill: parent anchors.fill: parent
anchors.topMargin: Theme.spacingL
clip: true clip: true
contentHeight: mainColumn.height contentHeight: mainColumn.height
contentWidth: width contentWidth: width

View File

@@ -228,10 +228,15 @@ Singleton {
function initializeGpuMetadata() { function initializeGpuMetadata() {
if (!dgopAvailable) if (!dgopAvailable)
return return
// Load GPU metadata once at startup for basic info
gpuInitProcess.running = true gpuInitProcess.running = true
} }
function initializeSystemMetadata() {
if (!dgopAvailable)
return
systemInitProcess.running = true
}
function buildDgopCommand() { function buildDgopCommand() {
const cmd = ["dgop", "meta", "--json"] const cmd = ["dgop", "meta", "--json"]
@@ -450,14 +455,14 @@ Singleton {
bootTime = sys.boottime || "" bootTime = sys.boottime || ""
} }
if (data.hardware) { const hwData = data.hardware || (data.hostname || data.kernel || data.distro || data.arch) ? data : null
const hw = data.hardware if (hwData) {
hostname = hw.hostname || "" hostname = hwData.hostname || ""
kernelVersion = hw.kernel || "" kernelVersion = hwData.kernel || ""
distribution = hw.distro || "" distribution = hwData.distro || ""
architecture = hw.arch || "" architecture = hwData.arch || ""
motherboard = (hw.bios && hw.bios.motherboard) || "" motherboard = (hwData.bios && hwData.bios.motherboard) || ""
biosVersion = (hw.bios && hw.bios.version) || "" biosVersion = (hwData.bios && hwData.bios.version) || ""
} }
isUpdating = false isUpdating = false
@@ -629,6 +634,29 @@ Singleton {
} }
} }
Process {
id: systemInitProcess
command: ["dgop", "hardware", "--json"]
running: false
onExited: exitCode => {
if (exitCode !== 0) {
console.warn("System init process failed with exit code:", exitCode)
}
}
stdout: StdioCollector {
onStreamFinished: {
if (text.trim()) {
try {
const data = JSON.parse(text.trim())
parseData(data)
} catch (e) {
console.warn("Failed to parse system init JSON:", e)
}
}
}
}
}
Process { Process {
id: dgopCheckProcess id: dgopCheckProcess
command: ["which", "dgop"] command: ["which", "dgop"]
@@ -637,12 +665,11 @@ Singleton {
dgopAvailable = (exitCode === 0) dgopAvailable = (exitCode === 0)
if (dgopAvailable) { if (dgopAvailable) {
initializeGpuMetadata() initializeGpuMetadata()
// Load persisted GPU PCI IDs from session state initializeSystemMetadata()
if (SessionData.enabledGpuPciIds && SessionData.enabledGpuPciIds.length > 0) { if (SessionData.enabledGpuPciIds && SessionData.enabledGpuPciIds.length > 0) {
for (const pciId of SessionData.enabledGpuPciIds) { for (const pciId of SessionData.enabledGpuPciIds) {
addGpuPciId(pciId) addGpuPciId(pciId)
} }
// Trigger update if we already have active modules
if (refCount > 0 && enabledModules.length > 0) { if (refCount > 0 && enabledModules.length > 0) {
updateAllStats() updateAllStats()
} }