mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-05-05 03:52:07 -04:00
feat(display): Fix and implement display auto-switching with JSON profile storage (#2275)
* feat(display): fix monitor auto config and add output disable guard * feat(display): fixed some race conditions and sole display getting disabled. Co-authored-by: Copilot <copilot@github.com> * feat(display): changes console log to use new log service * feat(display): fix trailing spaces * prek run * add migration, fix missing hyprland HDR parameters, use FileView > python --------- Co-authored-by: Copilot <copilot@github.com> Co-authored-by: bbedward <bbedward@gmail.com>
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -74,6 +74,8 @@ Column {
|
||||
DankToggle {
|
||||
width: parent.width
|
||||
text: I18n.tr("Disable Output")
|
||||
enabled: checked || DisplayConfigState.canDisableOutput()
|
||||
description: (!checked && !DisplayConfigState.canDisableOutput()) ? (Object.keys(DisplayConfigState.outputs).length <= 1 ? I18n.tr("Cannot disable the only output") : I18n.tr("At least one output must remain enabled")) : ""
|
||||
checked: DisplayConfigState.getHyprlandSetting(root.outputData, root.outputName, "disabled", false)
|
||||
onToggled: checked => DisplayConfigState.setHyprlandSetting(root.outputData, root.outputName, "disabled", checked)
|
||||
}
|
||||
|
||||
@@ -61,6 +61,8 @@ Column {
|
||||
DankToggle {
|
||||
width: parent.width
|
||||
text: I18n.tr("Disable Output")
|
||||
enabled: checked || DisplayConfigState.canDisableOutput()
|
||||
description: (!checked && !DisplayConfigState.canDisableOutput()) ? (Object.keys(DisplayConfigState.outputs).length <= 1 ? I18n.tr("Cannot disable the only output") : I18n.tr("At least one output must remain enabled")) : ""
|
||||
checked: DisplayConfigState.getNiriSetting(root.outputData, root.outputName, "disabled", false)
|
||||
onToggled: checked => DisplayConfigState.setNiriSetting(root.outputData, root.outputName, "disabled", checked)
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ StyledRect {
|
||||
const pendingScale = DisplayConfigState.getPendingValue(root.outputName, "scale");
|
||||
if (pendingScale !== undefined)
|
||||
return parseFloat(pendingScale.toFixed(2)).toString();
|
||||
const scale = DisplayConfigState.outputs[root.outputName]?.logical?.scale ?? 1.0;
|
||||
const scale = root.outputData?.logical?.scale || 1.0;
|
||||
return parseFloat(scale.toFixed(2)).toString();
|
||||
}
|
||||
|
||||
@@ -251,8 +251,7 @@ StyledRect {
|
||||
const pendingTransform = DisplayConfigState.getPendingValue(root.outputName, "transform");
|
||||
if (pendingTransform)
|
||||
return DisplayConfigState.getTransformLabel(pendingTransform);
|
||||
const data = DisplayConfigState.outputs[root.outputName];
|
||||
return DisplayConfigState.getTransformLabel(data?.logical?.transform ?? "Normal");
|
||||
return DisplayConfigState.getTransformLabel(root.outputData?.logical?.transform ?? "Normal");
|
||||
}
|
||||
options: [I18n.tr("Normal"), I18n.tr("90°"), I18n.tr("180°"), I18n.tr("270°"), I18n.tr("Flipped"), I18n.tr("Flipped 90°"), I18n.tr("Flipped 180°"), I18n.tr("Flipped 270°")]
|
||||
onValueChanged: value => DisplayConfigState.setPendingChange(root.outputName, "transform", DisplayConfigState.getTransformValue(value))
|
||||
|
||||
Reference in New Issue
Block a user