1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-28 15:32:50 -05:00

feat: DMS Cursor Control - Size & Theme in niri

This commit is contained in:
purian23
2026-01-06 19:08:05 -05:00
parent 8c9c936d0e
commit 721700190b
5 changed files with 251 additions and 2 deletions

View File

@@ -12,6 +12,7 @@ Item {
id: themeColorsTab
property var cachedIconThemes: SettingsData.availableIconThemes
property var cachedCursorThemes: SettingsData.availableCursorThemes
property var cachedMatugenSchemes: Theme.availableMatugenSchemes.map(option => option.label)
property var installedRegistryThemes: []
property var templateDetection: ({})
@@ -38,6 +39,7 @@ Item {
Component.onCompleted: {
SettingsData.detectAvailableIconThemes();
SettingsData.detectAvailableCursorThemes();
if (DMSService.dmsAvailable)
DMSService.listInstalledThemes();
if (PopoutService.pendingThemeInstall)
@@ -1638,6 +1640,86 @@ Item {
}
}
SettingsCard {
tab: "theme"
tags: ["cursor", "mouse", "pointer", "theme", "size"]
title: I18n.tr("Cursor Theme")
settingKey: "cursorTheme"
iconName: "mouse"
visible: CompositorService.isNiri
Column {
width: parent.width
spacing: Theme.spacingM
SettingsDropdownRow {
tab: "theme"
tags: ["cursor", "mouse", "pointer", "theme"]
settingKey: "cursorTheme"
text: I18n.tr("Cursor Theme")
description: I18n.tr("Mouse pointer appearance")
currentValue: SettingsData.cursorSettings.theme
enableFuzzySearch: true
popupWidthOffset: 100
maxPopupHeight: 236
options: cachedCursorThemes
onValueChanged: value => {
SettingsData.setCursorTheme(value);
}
}
SettingsSliderRow {
tab: "theme"
tags: ["cursor", "mouse", "pointer", "size"]
settingKey: "cursorSize"
text: I18n.tr("Cursor Size")
description: I18n.tr("Mouse pointer size in pixels")
value: SettingsData.cursorSettings.size
minimum: 16
maximum: 48
unit: "px"
defaultValue: 24
onSliderValueChanged: newValue => SettingsData.setCursorSize(newValue)
}
SettingsToggleRow {
tab: "theme"
tags: ["cursor", "hide", "typing"]
settingKey: "cursorHideWhenTyping"
text: I18n.tr("Hide When Typing")
description: I18n.tr("Hide cursor when pressing keyboard keys")
checked: SettingsData.cursorSettings.niri?.hideWhenTyping || false
onToggled: checked => {
const updated = JSON.parse(JSON.stringify(SettingsData.cursorSettings));
if (!updated.niri)
updated.niri = {};
updated.niri.hideWhenTyping = checked;
SettingsData.set("cursorSettings", updated);
}
}
SettingsSliderRow {
tab: "theme"
tags: ["cursor", "hide", "timeout", "inactive"]
settingKey: "cursorHideAfterInactive"
text: I18n.tr("Auto-Hide Timeout")
description: I18n.tr("Hide cursor after inactivity (0 = disabled)")
value: SettingsData.cursorSettings.niri?.hideAfterInactiveMs || 0
minimum: 0
maximum: 5000
unit: "ms"
defaultValue: 0
onSliderValueChanged: newValue => {
const updated = JSON.parse(JSON.stringify(SettingsData.cursorSettings));
if (!updated.niri)
updated.niri = {};
updated.niri.hideAfterInactiveMs = newValue;
SettingsData.set("cursorSettings", updated);
}
}
}
}
SettingsCard {
tab: "theme"
tags: ["system", "app", "theming", "gtk", "qt"]