mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 21:42:51 -05:00
plugins/desktop-widgets: create a new "desktop" widget plugin type
- Draggable per-monitor background layer widgets - Add basic dms version checks on plugins - Clock: built-in clock desktop plugin - dgop: built-in system monitor desktop plugin
This commit is contained in:
780
quickshell/Modules/Settings/DesktopWidgetsTab.qml
Normal file
780
quickshell/Modules/Settings/DesktopWidgetsTab.qml
Normal file
@@ -0,0 +1,780 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
import qs.Modules.Settings.Widgets
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
DankFlickable {
|
||||
anchors.fill: parent
|
||||
clip: true
|
||||
contentHeight: mainColumn.height + Theme.spacingXL
|
||||
contentWidth: width
|
||||
|
||||
Column {
|
||||
id: mainColumn
|
||||
width: Math.min(550, parent.width - Theme.spacingL * 2)
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
spacing: Theme.spacingXL
|
||||
|
||||
SettingsCard {
|
||||
width: parent.width
|
||||
iconName: "schedule"
|
||||
title: I18n.tr("Desktop Clock")
|
||||
collapsible: true
|
||||
expanded: false
|
||||
|
||||
SettingsToggleRow {
|
||||
text: I18n.tr("Enable Desktop Clock")
|
||||
checked: SettingsData.desktopClockEnabled
|
||||
onToggled: checked => SettingsData.set("desktopClockEnabled", checked)
|
||||
}
|
||||
|
||||
Column {
|
||||
width: parent.width
|
||||
spacing: 0
|
||||
visible: SettingsData.desktopClockEnabled
|
||||
opacity: visible ? 1 : 0
|
||||
|
||||
Behavior on opacity {
|
||||
NumberAnimation {
|
||||
duration: Theme.mediumDuration
|
||||
easing.type: Theme.emphasizedEasing
|
||||
}
|
||||
}
|
||||
|
||||
SettingsDivider {}
|
||||
|
||||
SettingsDropdownRow {
|
||||
text: I18n.tr("Clock Style")
|
||||
options: [I18n.tr("Digital"), I18n.tr("Analog"), I18n.tr("Stacked")]
|
||||
currentValue: {
|
||||
switch (SettingsData.desktopClockStyle) {
|
||||
case "analog":
|
||||
return I18n.tr("Analog");
|
||||
case "stacked":
|
||||
return I18n.tr("Stacked");
|
||||
default:
|
||||
return I18n.tr("Digital");
|
||||
}
|
||||
}
|
||||
onValueChanged: value => {
|
||||
switch (value) {
|
||||
case I18n.tr("Analog"):
|
||||
SettingsData.set("desktopClockStyle", "analog");
|
||||
return;
|
||||
case I18n.tr("Stacked"):
|
||||
SettingsData.set("desktopClockStyle", "stacked");
|
||||
return;
|
||||
default:
|
||||
SettingsData.set("desktopClockStyle", "digital");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SettingsDivider {
|
||||
visible: SettingsData.desktopClockStyle === "analog"
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
visible: SettingsData.desktopClockStyle === "analog"
|
||||
text: I18n.tr("Show Hour Numbers")
|
||||
checked: SettingsData.desktopClockShowAnalogNumbers
|
||||
onToggled: checked => SettingsData.set("desktopClockShowAnalogNumbers", checked)
|
||||
}
|
||||
|
||||
SettingsDivider {}
|
||||
|
||||
SettingsToggleRow {
|
||||
text: I18n.tr("Show Date")
|
||||
checked: SettingsData.desktopClockShowDate
|
||||
onToggled: checked => SettingsData.set("desktopClockShowDate", checked)
|
||||
}
|
||||
|
||||
SettingsDivider {}
|
||||
|
||||
SettingsSliderRow {
|
||||
text: I18n.tr("Transparency")
|
||||
minimum: 0
|
||||
maximum: 100
|
||||
value: Math.round(SettingsData.desktopClockTransparency * 100)
|
||||
unit: "%"
|
||||
onSliderValueChanged: newValue => SettingsData.set("desktopClockTransparency", newValue / 100)
|
||||
}
|
||||
|
||||
SettingsDivider {}
|
||||
|
||||
SettingsColorPicker {
|
||||
colorMode: SettingsData.desktopClockColorMode
|
||||
customColor: SettingsData.desktopClockCustomColor
|
||||
onColorModeSelected: mode => SettingsData.set("desktopClockColorMode", mode)
|
||||
onCustomColorSelected: selectedColor => SettingsData.set("desktopClockCustomColor", selectedColor.toString())
|
||||
}
|
||||
|
||||
SettingsDivider {}
|
||||
|
||||
SettingsDisplayPicker {
|
||||
displayPreferences: SettingsData.desktopClockDisplayPreferences
|
||||
onPreferencesChanged: prefs => SettingsData.set("desktopClockDisplayPreferences", prefs)
|
||||
}
|
||||
|
||||
SettingsDivider {}
|
||||
|
||||
Item {
|
||||
width: parent.width
|
||||
height: clockResetRow.height + Theme.spacingM * 2
|
||||
|
||||
Row {
|
||||
id: clockResetRow
|
||||
x: Theme.spacingM
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: Theme.spacingM
|
||||
|
||||
DankButton {
|
||||
text: I18n.tr("Reset Position")
|
||||
backgroundColor: Theme.surfaceHover
|
||||
textColor: Theme.surfaceText
|
||||
buttonHeight: 36
|
||||
onClicked: {
|
||||
SettingsData.set("desktopClockX", -1);
|
||||
SettingsData.set("desktopClockY", -1);
|
||||
}
|
||||
}
|
||||
|
||||
DankButton {
|
||||
text: I18n.tr("Reset Size")
|
||||
backgroundColor: Theme.surfaceHover
|
||||
textColor: Theme.surfaceText
|
||||
buttonHeight: 36
|
||||
onClicked: {
|
||||
SettingsData.set("desktopClockWidth", 280);
|
||||
SettingsData.set("desktopClockHeight", 180);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SettingsCard {
|
||||
width: parent.width
|
||||
iconName: "monitoring"
|
||||
title: I18n.tr("System Monitor")
|
||||
collapsible: true
|
||||
expanded: false
|
||||
|
||||
SettingsToggleRow {
|
||||
text: I18n.tr("Enable System Monitor")
|
||||
checked: SettingsData.systemMonitorEnabled
|
||||
onToggled: checked => SettingsData.set("systemMonitorEnabled", checked)
|
||||
}
|
||||
|
||||
Column {
|
||||
width: parent.width
|
||||
spacing: 0
|
||||
visible: SettingsData.systemMonitorEnabled
|
||||
opacity: visible ? 1 : 0
|
||||
|
||||
Behavior on opacity {
|
||||
NumberAnimation {
|
||||
duration: Theme.mediumDuration
|
||||
easing.type: Theme.emphasizedEasing
|
||||
}
|
||||
}
|
||||
|
||||
SettingsDivider {}
|
||||
|
||||
SettingsToggleRow {
|
||||
text: I18n.tr("Show Header")
|
||||
checked: SettingsData.systemMonitorShowHeader
|
||||
onToggled: checked => SettingsData.set("systemMonitorShowHeader", checked)
|
||||
}
|
||||
|
||||
SettingsDivider {}
|
||||
|
||||
Item {
|
||||
width: parent.width
|
||||
height: graphIntervalColumn.height + Theme.spacingM * 2
|
||||
|
||||
Column {
|
||||
id: graphIntervalColumn
|
||||
width: parent.width - Theme.spacingM * 2
|
||||
x: Theme.spacingM
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: Theme.spacingS
|
||||
|
||||
StyledText {
|
||||
text: I18n.tr("Graph Time Range")
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
color: Theme.surfaceText
|
||||
}
|
||||
|
||||
DankButtonGroup {
|
||||
model: ["1m", "5m", "10m", "30m"]
|
||||
currentIndex: {
|
||||
switch (SettingsData.systemMonitorGraphInterval) {
|
||||
case 60:
|
||||
return 0;
|
||||
case 300:
|
||||
return 1;
|
||||
case 600:
|
||||
return 2;
|
||||
case 1800:
|
||||
return 3;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
buttonHeight: 32
|
||||
minButtonWidth: 48
|
||||
textSize: Theme.fontSizeSmall
|
||||
checkEnabled: false
|
||||
onSelectionChanged: (index, selected) => {
|
||||
if (!selected)
|
||||
return;
|
||||
const values = [60, 300, 600, 1800];
|
||||
SettingsData.set("systemMonitorGraphInterval", values[index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SettingsDivider {}
|
||||
|
||||
SettingsToggleRow {
|
||||
text: I18n.tr("CPU")
|
||||
checked: SettingsData.systemMonitorShowCpu
|
||||
onToggled: checked => SettingsData.set("systemMonitorShowCpu", checked)
|
||||
}
|
||||
|
||||
SettingsDivider {
|
||||
visible: SettingsData.systemMonitorShowCpu
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
visible: SettingsData.systemMonitorShowCpu
|
||||
text: I18n.tr("CPU Graph")
|
||||
checked: SettingsData.systemMonitorShowCpuGraph
|
||||
onToggled: checked => SettingsData.set("systemMonitorShowCpuGraph", checked)
|
||||
}
|
||||
|
||||
SettingsDivider {
|
||||
visible: SettingsData.systemMonitorShowCpu
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
visible: SettingsData.systemMonitorShowCpu
|
||||
text: I18n.tr("CPU Temperature")
|
||||
checked: SettingsData.systemMonitorShowCpuTemp
|
||||
onToggled: checked => SettingsData.set("systemMonitorShowCpuTemp", checked)
|
||||
}
|
||||
|
||||
SettingsDivider {}
|
||||
|
||||
SettingsToggleRow {
|
||||
text: I18n.tr("GPU Temperature")
|
||||
checked: SettingsData.systemMonitorShowGpuTemp
|
||||
onToggled: checked => SettingsData.set("systemMonitorShowGpuTemp", checked)
|
||||
}
|
||||
|
||||
SettingsDivider {
|
||||
visible: SettingsData.systemMonitorShowGpuTemp && DgopService.availableGpus.length > 0
|
||||
}
|
||||
|
||||
Item {
|
||||
width: parent.width
|
||||
height: gpuSelectColumn.height + Theme.spacingM * 2
|
||||
visible: SettingsData.systemMonitorShowGpuTemp && DgopService.availableGpus.length > 0
|
||||
|
||||
Column {
|
||||
id: gpuSelectColumn
|
||||
width: parent.width - Theme.spacingM * 2
|
||||
x: Theme.spacingM
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: Theme.spacingS
|
||||
|
||||
StyledText {
|
||||
text: I18n.tr("GPU")
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
color: Theme.surfaceText
|
||||
}
|
||||
|
||||
Column {
|
||||
width: parent.width
|
||||
spacing: Theme.spacingXS
|
||||
|
||||
Repeater {
|
||||
model: DgopService.availableGpus
|
||||
|
||||
Rectangle {
|
||||
required property var modelData
|
||||
|
||||
width: parent.width
|
||||
height: 44
|
||||
radius: Theme.cornerRadius
|
||||
color: SettingsData.systemMonitorGpuPciId === modelData.pciId ? Theme.primarySelected : Theme.surfaceHover
|
||||
border.color: SettingsData.systemMonitorGpuPciId === modelData.pciId ? Theme.primary : "transparent"
|
||||
border.width: 2
|
||||
|
||||
Row {
|
||||
anchors.fill: parent
|
||||
anchors.margins: Theme.spacingS
|
||||
spacing: Theme.spacingS
|
||||
|
||||
DankIcon {
|
||||
name: "videocam"
|
||||
size: Theme.iconSizeSmall
|
||||
color: SettingsData.systemMonitorGpuPciId === modelData.pciId ? Theme.primary : Theme.surfaceVariantText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
Column {
|
||||
width: parent.width - Theme.iconSizeSmall - Theme.spacingS
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: 0
|
||||
|
||||
StyledText {
|
||||
text: modelData.displayName || "Unknown GPU"
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceText
|
||||
width: parent.width
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: modelData.driver || ""
|
||||
font.pixelSize: Theme.fontSizeSmall - 2
|
||||
color: Theme.surfaceVariantText
|
||||
visible: text !== ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: SettingsData.set("systemMonitorGpuPciId", modelData.pciId)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SettingsDivider {}
|
||||
|
||||
SettingsToggleRow {
|
||||
text: I18n.tr("Memory")
|
||||
checked: SettingsData.systemMonitorShowMemory
|
||||
onToggled: checked => SettingsData.set("systemMonitorShowMemory", checked)
|
||||
}
|
||||
|
||||
SettingsDivider {
|
||||
visible: SettingsData.systemMonitorShowMemory
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
visible: SettingsData.systemMonitorShowMemory
|
||||
text: I18n.tr("Memory Graph")
|
||||
checked: SettingsData.systemMonitorShowMemoryGraph
|
||||
onToggled: checked => SettingsData.set("systemMonitorShowMemoryGraph", checked)
|
||||
}
|
||||
|
||||
SettingsDivider {}
|
||||
|
||||
SettingsToggleRow {
|
||||
text: I18n.tr("Network")
|
||||
checked: SettingsData.systemMonitorShowNetwork
|
||||
onToggled: checked => SettingsData.set("systemMonitorShowNetwork", checked)
|
||||
}
|
||||
|
||||
SettingsDivider {
|
||||
visible: SettingsData.systemMonitorShowNetwork
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
visible: SettingsData.systemMonitorShowNetwork
|
||||
text: I18n.tr("Network Graph")
|
||||
checked: SettingsData.systemMonitorShowNetworkGraph
|
||||
onToggled: checked => SettingsData.set("systemMonitorShowNetworkGraph", checked)
|
||||
}
|
||||
|
||||
SettingsDivider {}
|
||||
|
||||
SettingsToggleRow {
|
||||
text: I18n.tr("Disk")
|
||||
checked: SettingsData.systemMonitorShowDisk
|
||||
onToggled: checked => SettingsData.set("systemMonitorShowDisk", checked)
|
||||
}
|
||||
|
||||
SettingsDivider {}
|
||||
|
||||
SettingsToggleRow {
|
||||
text: I18n.tr("Top Processes")
|
||||
checked: SettingsData.systemMonitorShowTopProcesses
|
||||
onToggled: checked => SettingsData.set("systemMonitorShowTopProcesses", checked)
|
||||
}
|
||||
|
||||
SettingsDivider {
|
||||
visible: SettingsData.systemMonitorShowTopProcesses
|
||||
}
|
||||
|
||||
Item {
|
||||
width: parent.width
|
||||
height: topProcessesColumn.height + Theme.spacingM * 2
|
||||
visible: SettingsData.systemMonitorShowTopProcesses
|
||||
|
||||
Column {
|
||||
id: topProcessesColumn
|
||||
width: parent.width - Theme.spacingM * 2
|
||||
x: Theme.spacingM
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: Theme.spacingM
|
||||
|
||||
Row {
|
||||
width: parent.width
|
||||
spacing: Theme.spacingM
|
||||
|
||||
StyledText {
|
||||
width: parent.width - processCountButtons.width - Theme.spacingM
|
||||
text: I18n.tr("Process Count")
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
color: Theme.surfaceText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
DankButtonGroup {
|
||||
id: processCountButtons
|
||||
model: ["3", "5", "10"]
|
||||
currentIndex: {
|
||||
switch (SettingsData.systemMonitorTopProcessCount) {
|
||||
case 3:
|
||||
return 0;
|
||||
case 5:
|
||||
return 1;
|
||||
case 10:
|
||||
return 2;
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
buttonHeight: 32
|
||||
minButtonWidth: 36
|
||||
textSize: Theme.fontSizeSmall
|
||||
checkEnabled: false
|
||||
onSelectionChanged: (index, selected) => {
|
||||
if (!selected)
|
||||
return;
|
||||
const values = [3, 5, 10];
|
||||
SettingsData.set("systemMonitorTopProcessCount", values[index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
width: parent.width
|
||||
spacing: Theme.spacingM
|
||||
|
||||
StyledText {
|
||||
width: parent.width - sortByButtons.width - Theme.spacingM
|
||||
text: I18n.tr("Sort By")
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
color: Theme.surfaceText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
DankButtonGroup {
|
||||
id: sortByButtons
|
||||
model: ["CPU", "MEM"]
|
||||
currentIndex: SettingsData.systemMonitorTopProcessSortBy === "cpu" ? 0 : 1
|
||||
buttonHeight: 32
|
||||
minButtonWidth: 48
|
||||
textSize: Theme.fontSizeSmall
|
||||
checkEnabled: false
|
||||
onSelectionChanged: (index, selected) => {
|
||||
if (!selected)
|
||||
return;
|
||||
SettingsData.set("systemMonitorTopProcessSortBy", index === 0 ? "cpu" : "memory");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SettingsDivider {}
|
||||
|
||||
SettingsDropdownRow {
|
||||
text: I18n.tr("Layout")
|
||||
options: [I18n.tr("Auto"), I18n.tr("Grid"), I18n.tr("List")]
|
||||
currentValue: {
|
||||
switch (SettingsData.systemMonitorLayoutMode) {
|
||||
case "grid":
|
||||
return I18n.tr("Grid");
|
||||
case "list":
|
||||
return I18n.tr("List");
|
||||
default:
|
||||
return I18n.tr("Auto");
|
||||
}
|
||||
}
|
||||
onValueChanged: value => {
|
||||
switch (value) {
|
||||
case I18n.tr("Grid"):
|
||||
SettingsData.set("systemMonitorLayoutMode", "grid");
|
||||
return;
|
||||
case I18n.tr("List"):
|
||||
SettingsData.set("systemMonitorLayoutMode", "list");
|
||||
return;
|
||||
default:
|
||||
SettingsData.set("systemMonitorLayoutMode", "auto");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SettingsDivider {}
|
||||
|
||||
SettingsSliderRow {
|
||||
text: I18n.tr("Transparency")
|
||||
minimum: 0
|
||||
maximum: 100
|
||||
value: Math.round(SettingsData.systemMonitorTransparency * 100)
|
||||
unit: "%"
|
||||
onSliderValueChanged: newValue => SettingsData.set("systemMonitorTransparency", newValue / 100)
|
||||
}
|
||||
|
||||
SettingsDivider {}
|
||||
|
||||
SettingsColorPicker {
|
||||
colorMode: SettingsData.systemMonitorColorMode
|
||||
customColor: SettingsData.systemMonitorCustomColor
|
||||
onColorModeSelected: mode => SettingsData.set("systemMonitorColorMode", mode)
|
||||
onCustomColorSelected: selectedColor => SettingsData.set("systemMonitorCustomColor", selectedColor.toString())
|
||||
}
|
||||
|
||||
SettingsDivider {}
|
||||
|
||||
SettingsDisplayPicker {
|
||||
displayPreferences: SettingsData.systemMonitorDisplayPreferences
|
||||
onPreferencesChanged: prefs => SettingsData.set("systemMonitorDisplayPreferences", prefs)
|
||||
}
|
||||
|
||||
SettingsDivider {}
|
||||
|
||||
Item {
|
||||
width: parent.width
|
||||
height: sysMonResetRow.height + Theme.spacingM * 2
|
||||
|
||||
Row {
|
||||
id: sysMonResetRow
|
||||
x: Theme.spacingM
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: Theme.spacingM
|
||||
|
||||
DankButton {
|
||||
text: I18n.tr("Reset Position")
|
||||
backgroundColor: Theme.surfaceHover
|
||||
textColor: Theme.surfaceText
|
||||
buttonHeight: 36
|
||||
onClicked: {
|
||||
SettingsData.set("systemMonitorX", -1);
|
||||
SettingsData.set("systemMonitorY", -1);
|
||||
}
|
||||
}
|
||||
|
||||
DankButton {
|
||||
text: I18n.tr("Reset Size")
|
||||
backgroundColor: Theme.surfaceHover
|
||||
textColor: Theme.surfaceText
|
||||
buttonHeight: 36
|
||||
onClicked: {
|
||||
SettingsData.set("systemMonitorWidth", 320);
|
||||
SettingsData.set("systemMonitorHeight", 480);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SettingsDivider {}
|
||||
|
||||
Item {
|
||||
width: parent.width
|
||||
height: variantsColumn.height + Theme.spacingM * 2
|
||||
|
||||
Column {
|
||||
id: variantsColumn
|
||||
width: parent.width - Theme.spacingM * 2
|
||||
x: Theme.spacingM
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: Theme.spacingM
|
||||
|
||||
Row {
|
||||
width: parent.width
|
||||
spacing: Theme.spacingM
|
||||
|
||||
StyledText {
|
||||
width: parent.width - addVariantBtn.width - Theme.spacingM
|
||||
text: I18n.tr("Widget Variants")
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
color: Theme.surfaceText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
DankButton {
|
||||
id: addVariantBtn
|
||||
text: I18n.tr("Add")
|
||||
iconName: "add"
|
||||
onClicked: {
|
||||
const variant = SettingsData.createSystemMonitorVariant("Monitor " + (SettingsData.systemMonitorVariants.length + 1), SettingsData.getDefaultSystemMonitorConfig());
|
||||
if (variant)
|
||||
ToastService.showInfo(I18n.tr("Variant created - expand to configure"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
id: variantsListColumn
|
||||
width: parent.width
|
||||
spacing: Theme.spacingS
|
||||
visible: SettingsData.systemMonitorVariants.length > 0
|
||||
|
||||
property var expandedStates: ({})
|
||||
|
||||
Repeater {
|
||||
model: SettingsData.systemMonitorVariants
|
||||
|
||||
SystemMonitorVariantCard {
|
||||
required property var modelData
|
||||
required property int index
|
||||
|
||||
width: parent.width
|
||||
variant: modelData
|
||||
expanded: variantsListColumn.expandedStates[modelData.id] || false
|
||||
|
||||
onExpandToggled: isExpanded => {
|
||||
var states = JSON.parse(JSON.stringify(variantsListColumn.expandedStates));
|
||||
states[modelData.id] = isExpanded;
|
||||
variantsListColumn.expandedStates = states;
|
||||
}
|
||||
|
||||
onDeleteRequested: {
|
||||
SettingsData.removeSystemMonitorVariant(modelData.id);
|
||||
ToastService.showInfo(I18n.tr("Variant removed"));
|
||||
}
|
||||
|
||||
onNameChanged: newName => {
|
||||
SettingsData.updateSystemMonitorVariant(modelData.id, {
|
||||
name: newName
|
||||
});
|
||||
}
|
||||
|
||||
onConfigChanged: (key, value) => {
|
||||
var update = {};
|
||||
update[key] = value;
|
||||
SettingsData.updateSystemMonitorVariant(modelData.id, update);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StyledText {
|
||||
visible: SettingsData.systemMonitorVariants.length === 0
|
||||
text: I18n.tr("No variants created. Click Add to create a new monitor widget.")
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceVariantText
|
||||
width: parent.width
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SettingsCard {
|
||||
width: parent.width
|
||||
iconName: "info"
|
||||
title: I18n.tr("Help")
|
||||
|
||||
Column {
|
||||
width: parent.width - Theme.spacingM * 2
|
||||
x: Theme.spacingM
|
||||
spacing: Theme.spacingM
|
||||
|
||||
Row {
|
||||
spacing: Theme.spacingM
|
||||
|
||||
Rectangle {
|
||||
width: 40
|
||||
height: 40
|
||||
radius: 20
|
||||
color: Theme.primarySelected
|
||||
|
||||
DankIcon {
|
||||
anchors.centerIn: parent
|
||||
name: "drag_pan"
|
||||
size: Theme.iconSize
|
||||
color: Theme.primary
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
spacing: 2
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
StyledText {
|
||||
text: I18n.tr("Move Widget")
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
font.weight: Font.Medium
|
||||
color: Theme.surfaceText
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: I18n.tr("Right-click and drag anywhere on the widget")
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceVariantText
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
spacing: Theme.spacingM
|
||||
|
||||
Rectangle {
|
||||
width: 40
|
||||
height: 40
|
||||
radius: 20
|
||||
color: Theme.primarySelected
|
||||
|
||||
DankIcon {
|
||||
anchors.centerIn: parent
|
||||
name: "open_in_full"
|
||||
size: Theme.iconSize
|
||||
color: Theme.primary
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
spacing: 2
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
StyledText {
|
||||
text: I18n.tr("Resize Widget")
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
font.weight: Font.Medium
|
||||
color: Theme.surfaceText
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: I18n.tr("Right-click and drag the bottom-right corner")
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceVariantText
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -983,9 +983,10 @@ Singleton {
|
||||
if (output.logical.x !== undefined && output.logical.y !== undefined)
|
||||
kdlContent += ` position x=${output.logical.x} y=${output.logical.y}\n`;
|
||||
}
|
||||
if (output.vrr_enabled) {
|
||||
const vrrOnDemand = settings.vrrOnDemand ?? false;
|
||||
kdlContent += vrrOnDemand ? ` variable-refresh-rate on-demand=true\n` : ` variable-refresh-rate\n`;
|
||||
if (settings.vrrOnDemand) {
|
||||
kdlContent += ` variable-refresh-rate on-demand=true\n`;
|
||||
} else if (output.vrr_enabled) {
|
||||
kdlContent += ` variable-refresh-rate\n`;
|
||||
}
|
||||
if (settings.focusAtStartup)
|
||||
kdlContent += ` focus-at-startup\n`;
|
||||
|
||||
@@ -29,6 +29,15 @@ StyledRect {
|
||||
property var pluginPermissions: pluginData ? (pluginData.permissions || []) : []
|
||||
property bool hasSettings: pluginData && pluginData.settings !== undefined && pluginData.settings !== ""
|
||||
property bool isSystemPlugin: pluginData ? (pluginData.source === "system") : false
|
||||
property string requiresDms: pluginData ? (pluginData.requires_dms || "") : ""
|
||||
property bool meetsRequirements: requiresDms ? PluginService.checkPluginCompatibility(requiresDms) : true
|
||||
|
||||
Connections {
|
||||
target: SystemUpdateService
|
||||
function onSemverVersionChanged() {
|
||||
root.meetsRequirementsChanged();
|
||||
}
|
||||
}
|
||||
property bool isExpanded: expandedPluginId === pluginId
|
||||
property bool isLoaded: {
|
||||
PluginService.loadedPlugins;
|
||||
@@ -90,6 +99,41 @@ StyledRect {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: incompatIcon.width + Theme.spacingXS * 2
|
||||
height: 18
|
||||
radius: 9
|
||||
color: Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.15)
|
||||
visible: !root.meetsRequirements
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
Row {
|
||||
anchors.centerIn: parent
|
||||
spacing: 2
|
||||
|
||||
DankIcon {
|
||||
id: incompatIcon
|
||||
name: "warning"
|
||||
size: 12
|
||||
color: Theme.error
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onEntered: {
|
||||
if (root.sharedTooltip)
|
||||
root.sharedTooltip.show(I18n.tr("Requires DMS") + " " + root.requiresDms, parent, 0, 0, "top");
|
||||
}
|
||||
onExited: {
|
||||
if (root.sharedTooltip)
|
||||
root.sharedTooltip.hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DankIcon {
|
||||
name: root.hasSettings ? (root.isExpanded ? "expand_less" : "expand_more") : ""
|
||||
size: 16
|
||||
|
||||
@@ -120,6 +120,75 @@ FocusScope {
|
||||
}
|
||||
}
|
||||
|
||||
StyledRect {
|
||||
id: incompatWarning
|
||||
property var incompatPlugins: []
|
||||
width: parent.width
|
||||
height: incompatWarningColumn.implicitHeight + Theme.spacingM * 2
|
||||
radius: Theme.cornerRadius
|
||||
color: Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.1)
|
||||
border.color: Theme.error
|
||||
border.width: 1
|
||||
visible: incompatPlugins.length > 0
|
||||
|
||||
function refresh() {
|
||||
incompatPlugins = PluginService.getIncompatiblePlugins();
|
||||
}
|
||||
|
||||
Component.onCompleted: Qt.callLater(refresh)
|
||||
|
||||
Column {
|
||||
id: incompatWarningColumn
|
||||
anchors.fill: parent
|
||||
anchors.margins: Theme.spacingM
|
||||
spacing: Theme.spacingXS
|
||||
|
||||
Row {
|
||||
spacing: Theme.spacingXS
|
||||
|
||||
DankIcon {
|
||||
name: "error"
|
||||
size: 16
|
||||
color: Theme.error
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: I18n.tr("Incompatible Plugins Loaded")
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.error
|
||||
font.weight: Font.Medium
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: I18n.tr("Some plugins require a newer version of DMS:") + " " + incompatWarning.incompatPlugins.map(p => p.name + " (" + p.requires_dms + ")").join(", ")
|
||||
font.pixelSize: Theme.fontSizeSmall - 1
|
||||
color: Theme.surfaceVariantText
|
||||
wrapMode: Text.WordWrap
|
||||
width: parent.width
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: PluginService
|
||||
function onPluginLoaded() {
|
||||
incompatWarning.refresh();
|
||||
}
|
||||
function onPluginUnloaded() {
|
||||
incompatWarning.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: SystemUpdateService
|
||||
function onSemverVersionChanged() {
|
||||
incompatWarning.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Flow {
|
||||
width: parent.width
|
||||
spacing: Theme.spacingM
|
||||
|
||||
119
quickshell/Modules/Settings/Widgets/SettingsColorPicker.qml
Normal file
119
quickshell/Modules/Settings/Widgets/SettingsColorPicker.qml
Normal file
@@ -0,0 +1,119 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
property string colorMode: "primary"
|
||||
property color customColor: "#ffffff"
|
||||
property string pickerTitle: I18n.tr("Choose Color")
|
||||
|
||||
signal colorModeSelected(string mode)
|
||||
signal customColorSelected(color selectedColor)
|
||||
|
||||
width: parent?.width ?? 0
|
||||
height: colorColumn.height + Theme.spacingM * 2
|
||||
|
||||
Column {
|
||||
id: colorColumn
|
||||
width: parent.width - Theme.spacingM * 2
|
||||
x: Theme.spacingM
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: Theme.spacingM
|
||||
|
||||
StyledText {
|
||||
text: I18n.tr("Color")
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
color: Theme.surfaceText
|
||||
}
|
||||
|
||||
Row {
|
||||
width: parent.width
|
||||
spacing: Theme.spacingS
|
||||
|
||||
Repeater {
|
||||
model: [
|
||||
{
|
||||
id: "primary",
|
||||
label: I18n.tr("Primary"),
|
||||
color: Theme.primary
|
||||
},
|
||||
{
|
||||
id: "secondary",
|
||||
label: I18n.tr("Secondary"),
|
||||
color: Theme.secondary
|
||||
},
|
||||
{
|
||||
id: "custom",
|
||||
label: I18n.tr("Custom"),
|
||||
color: root.customColor
|
||||
}
|
||||
]
|
||||
|
||||
Rectangle {
|
||||
required property var modelData
|
||||
required property int index
|
||||
|
||||
width: (parent.width - Theme.spacingS * 2) / 3
|
||||
height: 60
|
||||
radius: Theme.cornerRadius
|
||||
color: root.colorMode === modelData.id ? Theme.primarySelected : Theme.surfaceHover
|
||||
border.color: root.colorMode === modelData.id ? Theme.primary : "transparent"
|
||||
border.width: 2
|
||||
|
||||
Column {
|
||||
anchors.centerIn: parent
|
||||
spacing: Theme.spacingXS
|
||||
|
||||
Rectangle {
|
||||
width: 24
|
||||
height: 24
|
||||
radius: 12
|
||||
color: modelData.color
|
||||
border.color: Theme.outline
|
||||
border.width: 1
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
DankIcon {
|
||||
visible: modelData.id === "custom"
|
||||
anchors.centerIn: parent
|
||||
name: "colorize"
|
||||
size: 14
|
||||
color: Theme.background
|
||||
}
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: modelData.label
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceText
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
if (modelData.id !== "custom") {
|
||||
root.colorModeSelected(modelData.id);
|
||||
return;
|
||||
}
|
||||
PopoutService.colorPickerModal.selectedColor = root.customColor;
|
||||
PopoutService.colorPickerModal.pickerTitle = root.pickerTitle;
|
||||
PopoutService.colorPickerModal.onColorSelectedCallback = function (selectedColor) {
|
||||
root.customColorSelected(selectedColor);
|
||||
root.colorModeSelected("custom");
|
||||
};
|
||||
PopoutService.colorPickerModal.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import qs.Common
|
||||
import qs.Widgets
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
property var displayPreferences: []
|
||||
|
||||
signal preferencesChanged(var preferences)
|
||||
|
||||
readonly property bool allDisplaysEnabled: {
|
||||
if (!Array.isArray(displayPreferences))
|
||||
return true;
|
||||
return displayPreferences.includes("all") || displayPreferences.length === 0;
|
||||
}
|
||||
|
||||
width: parent?.width ?? 0
|
||||
height: displayColumn.height + Theme.spacingM * 2
|
||||
|
||||
Column {
|
||||
id: displayColumn
|
||||
width: parent.width - Theme.spacingM * 2
|
||||
x: Theme.spacingM
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: Theme.spacingM
|
||||
|
||||
StyledText {
|
||||
text: I18n.tr("Displays")
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
color: Theme.surfaceText
|
||||
}
|
||||
|
||||
DankToggle {
|
||||
width: parent.width
|
||||
text: I18n.tr("All displays")
|
||||
checked: root.allDisplaysEnabled
|
||||
onToggled: isChecked => root.preferencesChanged(isChecked ? ["all"] : [])
|
||||
}
|
||||
|
||||
Column {
|
||||
width: parent.width
|
||||
spacing: Theme.spacingXS
|
||||
visible: !root.allDisplaysEnabled
|
||||
|
||||
Repeater {
|
||||
model: Quickshell.screens
|
||||
|
||||
DankToggle {
|
||||
required property var modelData
|
||||
|
||||
width: parent.width
|
||||
text: SettingsData.getScreenDisplayName(modelData)
|
||||
description: modelData.width + "×" + modelData.height
|
||||
checked: {
|
||||
const prefs = root.displayPreferences;
|
||||
if (!Array.isArray(prefs) || prefs.includes("all"))
|
||||
return false;
|
||||
return prefs.some(p => p.name === modelData.name);
|
||||
}
|
||||
onToggled: isChecked => {
|
||||
var prefs = root.displayPreferences;
|
||||
if (!Array.isArray(prefs) || prefs.includes("all"))
|
||||
prefs = [];
|
||||
prefs = prefs.filter(p => p.name !== modelData.name);
|
||||
if (isChecked) {
|
||||
prefs.push({
|
||||
name: modelData.name,
|
||||
model: modelData.model || ""
|
||||
});
|
||||
}
|
||||
root.preferencesChanged(prefs);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
quickshell/Modules/Settings/Widgets/SettingsDivider.qml
Normal file
11
quickshell/Modules/Settings/Widgets/SettingsDivider.qml
Normal file
@@ -0,0 +1,11 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import qs.Common
|
||||
|
||||
Rectangle {
|
||||
width: parent?.width ?? 0
|
||||
height: 1
|
||||
color: Theme.outline
|
||||
opacity: 0.15
|
||||
}
|
||||
381
quickshell/Modules/Settings/Widgets/SystemMonitorVariantCard.qml
Normal file
381
quickshell/Modules/Settings/Widgets/SystemMonitorVariantCard.qml
Normal file
@@ -0,0 +1,381 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
|
||||
property var variant: ({})
|
||||
property bool expanded: false
|
||||
|
||||
signal expandToggled(bool isExpanded)
|
||||
signal deleteRequested
|
||||
signal nameChanged(string newName)
|
||||
signal configChanged(string key, var value)
|
||||
|
||||
readonly property var cfg: variant.config || {}
|
||||
|
||||
function updateConfig(key, value) {
|
||||
var newConfig = JSON.parse(JSON.stringify(cfg));
|
||||
newConfig[key] = value;
|
||||
root.configChanged("config", newConfig);
|
||||
}
|
||||
|
||||
width: parent?.width ?? 0
|
||||
height: variantColumn.height
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHigh
|
||||
clip: true
|
||||
|
||||
Column {
|
||||
id: variantColumn
|
||||
width: parent.width
|
||||
spacing: 0
|
||||
|
||||
Item {
|
||||
width: parent.width
|
||||
height: headerContent.height + Theme.spacingM * 2
|
||||
|
||||
Row {
|
||||
id: headerContent
|
||||
x: Theme.spacingM
|
||||
y: Theme.spacingM
|
||||
width: parent.width - Theme.spacingM * 2
|
||||
spacing: Theme.spacingM
|
||||
|
||||
DankIcon {
|
||||
name: root.expanded ? "expand_less" : "expand_more"
|
||||
size: Theme.iconSize
|
||||
color: Theme.surfaceVariantText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
Column {
|
||||
width: parent.width - Theme.iconSize - deleteBtn.width - Theme.spacingM * 2
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: 0
|
||||
|
||||
StyledText {
|
||||
text: root.variant.name || "Unnamed"
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
color: Theme.surfaceText
|
||||
width: parent.width
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
StyledText {
|
||||
property var features: {
|
||||
var f = [];
|
||||
if (root.cfg.showCpu)
|
||||
f.push("CPU");
|
||||
if (root.cfg.showMemory)
|
||||
f.push("RAM");
|
||||
if (root.cfg.showNetwork)
|
||||
f.push("Net");
|
||||
if (root.cfg.showDisk)
|
||||
f.push("Disk");
|
||||
if (root.cfg.showGpuTemp)
|
||||
f.push("GPU");
|
||||
return f;
|
||||
}
|
||||
text: features.length > 0 ? features.join(", ") : I18n.tr("No features enabled")
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceVariantText
|
||||
width: parent.width
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: deleteBtn
|
||||
width: 32
|
||||
height: 32
|
||||
radius: 16
|
||||
color: deleteMouse.containsMouse ? Theme.error : "transparent"
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
DankIcon {
|
||||
anchors.centerIn: parent
|
||||
name: "delete"
|
||||
size: 16
|
||||
color: deleteMouse.containsMouse ? Theme.background : Theme.surfaceVariantText
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: deleteMouse
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: root.deleteRequested()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
anchors.rightMargin: deleteBtn.width + Theme.spacingM
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: root.expandToggled(!root.expanded)
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
width: parent.width
|
||||
spacing: 0
|
||||
visible: root.expanded
|
||||
|
||||
SettingsDivider {}
|
||||
|
||||
Item {
|
||||
width: parent.width
|
||||
height: nameRow.height + Theme.spacingM * 2
|
||||
|
||||
Row {
|
||||
id: nameRow
|
||||
x: Theme.spacingM
|
||||
y: Theme.spacingM
|
||||
width: parent.width - Theme.spacingM * 2
|
||||
spacing: Theme.spacingM
|
||||
|
||||
StyledText {
|
||||
text: I18n.tr("Name")
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceVariantText
|
||||
width: 80
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
DankTextField {
|
||||
width: parent.width - 80 - Theme.spacingM
|
||||
text: root.variant.name || ""
|
||||
onEditingFinished: {
|
||||
if (text !== root.variant.name)
|
||||
root.nameChanged(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SettingsDivider {}
|
||||
|
||||
DankToggle {
|
||||
width: parent.width - Theme.spacingM * 2
|
||||
x: Theme.spacingM
|
||||
text: I18n.tr("Show Header")
|
||||
checked: root.cfg.showHeader ?? true
|
||||
onToggled: checked => root.updateConfig("showHeader", checked)
|
||||
}
|
||||
|
||||
SettingsDivider {}
|
||||
|
||||
DankToggle {
|
||||
width: parent.width - Theme.spacingM * 2
|
||||
x: Theme.spacingM
|
||||
text: I18n.tr("Show CPU")
|
||||
checked: root.cfg.showCpu ?? true
|
||||
onToggled: checked => root.updateConfig("showCpu", checked)
|
||||
}
|
||||
|
||||
DankToggle {
|
||||
width: parent.width - Theme.spacingM * 2
|
||||
x: Theme.spacingM
|
||||
text: I18n.tr("Show CPU Graph")
|
||||
visible: root.cfg.showCpu
|
||||
checked: root.cfg.showCpuGraph ?? true
|
||||
onToggled: checked => root.updateConfig("showCpuGraph", checked)
|
||||
}
|
||||
|
||||
DankToggle {
|
||||
width: parent.width - Theme.spacingM * 2
|
||||
x: Theme.spacingM
|
||||
text: I18n.tr("Show CPU Temp")
|
||||
visible: root.cfg.showCpu
|
||||
checked: root.cfg.showCpuTemp ?? true
|
||||
onToggled: checked => root.updateConfig("showCpuTemp", checked)
|
||||
}
|
||||
|
||||
SettingsDivider {}
|
||||
|
||||
DankToggle {
|
||||
width: parent.width - Theme.spacingM * 2
|
||||
x: Theme.spacingM
|
||||
text: I18n.tr("Show Memory")
|
||||
checked: root.cfg.showMemory ?? true
|
||||
onToggled: checked => root.updateConfig("showMemory", checked)
|
||||
}
|
||||
|
||||
DankToggle {
|
||||
width: parent.width - Theme.spacingM * 2
|
||||
x: Theme.spacingM
|
||||
text: I18n.tr("Show Memory Graph")
|
||||
visible: root.cfg.showMemory
|
||||
checked: root.cfg.showMemoryGraph ?? true
|
||||
onToggled: checked => root.updateConfig("showMemoryGraph", checked)
|
||||
}
|
||||
|
||||
SettingsDivider {}
|
||||
|
||||
DankToggle {
|
||||
width: parent.width - Theme.spacingM * 2
|
||||
x: Theme.spacingM
|
||||
text: I18n.tr("Show Network")
|
||||
checked: root.cfg.showNetwork ?? true
|
||||
onToggled: checked => root.updateConfig("showNetwork", checked)
|
||||
}
|
||||
|
||||
DankToggle {
|
||||
width: parent.width - Theme.spacingM * 2
|
||||
x: Theme.spacingM
|
||||
text: I18n.tr("Show Network Graph")
|
||||
visible: root.cfg.showNetwork
|
||||
checked: root.cfg.showNetworkGraph ?? true
|
||||
onToggled: checked => root.updateConfig("showNetworkGraph", checked)
|
||||
}
|
||||
|
||||
SettingsDivider {}
|
||||
|
||||
DankToggle {
|
||||
width: parent.width - Theme.spacingM * 2
|
||||
x: Theme.spacingM
|
||||
text: I18n.tr("Show Disk")
|
||||
checked: root.cfg.showDisk ?? true
|
||||
onToggled: checked => root.updateConfig("showDisk", checked)
|
||||
}
|
||||
|
||||
SettingsDivider {}
|
||||
|
||||
DankToggle {
|
||||
width: parent.width - Theme.spacingM * 2
|
||||
x: Theme.spacingM
|
||||
text: I18n.tr("Show GPU Temperature")
|
||||
checked: root.cfg.showGpuTemp ?? false
|
||||
onToggled: checked => root.updateConfig("showGpuTemp", checked)
|
||||
}
|
||||
|
||||
Column {
|
||||
width: parent.width
|
||||
spacing: Theme.spacingXS
|
||||
visible: root.cfg.showGpuTemp && DgopService.availableGpus.length > 0
|
||||
|
||||
Item {
|
||||
width: 1
|
||||
height: Theme.spacingS
|
||||
}
|
||||
|
||||
Repeater {
|
||||
model: DgopService.availableGpus
|
||||
|
||||
Rectangle {
|
||||
required property var modelData
|
||||
|
||||
width: parent.width - Theme.spacingM * 2
|
||||
x: Theme.spacingM
|
||||
height: 40
|
||||
radius: Theme.cornerRadius
|
||||
color: root.cfg.gpuPciId === modelData.pciId ? Theme.primarySelected : Theme.surfaceContainer
|
||||
border.color: root.cfg.gpuPciId === modelData.pciId ? Theme.primary : "transparent"
|
||||
border.width: 2
|
||||
|
||||
Row {
|
||||
anchors.fill: parent
|
||||
anchors.margins: Theme.spacingS
|
||||
spacing: Theme.spacingS
|
||||
|
||||
DankIcon {
|
||||
name: "videocam"
|
||||
size: Theme.iconSizeSmall
|
||||
color: root.cfg.gpuPciId === modelData.pciId ? Theme.primary : Theme.surfaceVariantText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: modelData.displayName || "Unknown GPU"
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceText
|
||||
width: parent.width - Theme.iconSizeSmall - Theme.spacingS
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: root.updateConfig("gpuPciId", modelData.pciId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
width: 1
|
||||
height: Theme.spacingS
|
||||
}
|
||||
}
|
||||
|
||||
SettingsDivider {}
|
||||
|
||||
DankToggle {
|
||||
width: parent.width - Theme.spacingM * 2
|
||||
x: Theme.spacingM
|
||||
text: I18n.tr("Show Top Processes")
|
||||
checked: root.cfg.showTopProcesses ?? false
|
||||
onToggled: checked => root.updateConfig("showTopProcesses", checked)
|
||||
}
|
||||
|
||||
SettingsDivider {}
|
||||
|
||||
Column {
|
||||
width: parent.width - Theme.spacingM * 2
|
||||
x: Theme.spacingM
|
||||
topPadding: Theme.spacingM
|
||||
bottomPadding: Theme.spacingM
|
||||
spacing: Theme.spacingS
|
||||
|
||||
Row {
|
||||
width: parent.width
|
||||
|
||||
StyledText {
|
||||
id: transparencyLabel
|
||||
text: I18n.tr("Transparency")
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceVariantText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
Item {
|
||||
width: parent.width - transparencyLabel.width - transparencyValue.width
|
||||
height: 1
|
||||
}
|
||||
|
||||
StyledText {
|
||||
id: transparencyValue
|
||||
text: transparencySlider.value + "%"
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
font.weight: Font.Medium
|
||||
color: Theme.primary
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
}
|
||||
|
||||
DankSlider {
|
||||
id: transparencySlider
|
||||
width: parent.width
|
||||
minimum: 0
|
||||
maximum: 100
|
||||
value: Math.round((root.cfg.transparency ?? 0.8) * 100)
|
||||
showValue: false
|
||||
wheelEnabled: false
|
||||
onSliderDragFinished: finalValue => root.updateConfig("transparency", finalValue / 100)
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
width: 1
|
||||
height: Theme.spacingM
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user