1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-05-12 23:32:50 -04:00

Automatic Display Profiles Enhancement & Disabled Output Support (#2367)

* fix(niri): properly close KDL output block when disabled

* feat(display): parse off directive and sync disabled state from compositor configs

* feat(display): visual treatment and canvas filtering for disabled outputs

* feat(display): eager auto-profile generation with debounced auto-select

* refactor(display): pass target profile ID to confirmChanges and remove dead code

* fix(display): make profile dropdown reactive by binding to property directly

* i18n(display): add Disabled translation term for output state
This commit is contained in:
Kilian Mio
2026-05-11 15:34:51 +02:00
committed by GitHub
parent 2b6ae58bff
commit a5352623fd
9 changed files with 254 additions and 106 deletions
@@ -11,7 +11,15 @@ Item {
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
property string selectedProfileId: SettingsData.getActiveDisplayProfile(CompositorService.compositor)
property string selectedProfileId: {
const id = SettingsData.activeDisplayProfile[CompositorService.compositor] || "";
if (!SettingsData.displayProfileAutoSelect) {
const profile = DisplayConfigState.validatedProfiles[id];
if (profile && profile.name === "")
return "";
}
return id;
}
property bool showNewProfileDialog: false
property bool showDeleteConfirmDialog: false
property bool showRenameDialog: false
@@ -60,15 +68,12 @@ Item {
function onChangesReverted() {
}
function onProfileActivated(profileId, profileName) {
root.selectedProfileId = profileId;
ToastService.showInfo(I18n.tr("Profile activated: %1").arg(profileName));
}
function onProfileSaved(profileId, profileName) {
root.selectedProfileId = profileId;
ToastService.showInfo(I18n.tr("Profile saved: %1").arg(profileName));
}
function onProfileDeleted(profileId) {
root.selectedProfileId = SettingsData.getActiveDisplayProfile(CompositorService.compositor);
ToastService.showInfo(I18n.tr("Profile deleted"));
}
function onProfileError(message) {
@@ -163,6 +168,8 @@ Item {
checked: SettingsData.displayProfileAutoSelect
onToggled: checked => {
SettingsData.displayProfileAutoSelect = checked;
if (!checked)
SettingsData.setActiveDisplayProfile(CompositorService.compositor, "");
SettingsData.saveSettings();
if (checked)
DisplayConfigState.applyAutoConfig();
@@ -624,7 +631,7 @@ Item {
DisplayConfirmationModal {
id: confirmationModal
onConfirmed: DisplayConfigState.confirmChanges()
onConfirmed: DisplayConfigState.confirmChanges(root.selectedProfileId)
onReverted: DisplayConfigState.revertChanges()
}
}