mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 21:42:51 -05:00
Added mirroring option to display configuration (#1156)
* <quickshell/Modules/Settings/DisplayConfig>: Added mirroring option to the displayconfiguration * removed niri option for mirroring * Fix trailing whitespace * removed emty rows --------- Co-authored-by: Postboote1 <stoessel.matthias>
This commit is contained in:
@@ -10,7 +10,7 @@ import qs.Services
|
|||||||
Singleton {
|
Singleton {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
readonly property bool hasOutputBackend: WlrOutputService.wlrOutputAvailable
|
readonly property bool hasOutputBackend: WlrOutputService.wlrOutputAvailable
|
||||||
readonly property var wlrOutputs: WlrOutputService.outputs
|
readonly property var wlrOutputs: WlrOutputService.outputs
|
||||||
property var outputs: ({})
|
property var outputs: ({})
|
||||||
property var savedOutputs: ({})
|
property var savedOutputs: ({})
|
||||||
@@ -238,6 +238,11 @@ Singleton {
|
|||||||
if (sdrSaturationMatch)
|
if (sdrSaturationMatch)
|
||||||
sdrSaturation = parseFloat(sdrSaturationMatch[1]);
|
sdrSaturation = parseFloat(sdrSaturationMatch[1]);
|
||||||
|
|
||||||
|
let mirror = "";
|
||||||
|
const mirrorMatch = rest.match(/,\s*mirror,\s*([^,\s]+)/);
|
||||||
|
if (mirrorMatch)
|
||||||
|
mirror = mirrorMatch[1];
|
||||||
|
|
||||||
result[name] = {
|
result[name] = {
|
||||||
"name": name,
|
"name": name,
|
||||||
"logical": {
|
"logical": {
|
||||||
@@ -261,7 +266,8 @@ Singleton {
|
|||||||
"colorManagement": cm,
|
"colorManagement": cm,
|
||||||
"sdrBrightness": sdrBrightness,
|
"sdrBrightness": sdrBrightness,
|
||||||
"sdrSaturation": sdrSaturation
|
"sdrSaturation": sdrSaturation
|
||||||
}
|
},
|
||||||
|
"mirror": mirror
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@@ -573,6 +579,8 @@ Singleton {
|
|||||||
result[outputName].logical.transform = changes.transform;
|
result[outputName].logical.transform = changes.transform;
|
||||||
if (changes.vrr !== undefined)
|
if (changes.vrr !== undefined)
|
||||||
result[outputName].vrr_enabled = changes.vrr;
|
result[outputName].vrr_enabled = changes.vrr;
|
||||||
|
if (changes.mirror !== undefined)
|
||||||
|
result[outputName].mirror = changes.mirror;
|
||||||
}
|
}
|
||||||
return normalizeOutputPositions(result);
|
return normalizeOutputPositions(result);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,6 +71,34 @@ Column {
|
|||||||
}
|
}
|
||||||
property bool isHdrMode: currentCm === "hdr" || currentCm === "hdredid"
|
property bool isHdrMode: currentCm === "hdr" || currentCm === "hdredid"
|
||||||
|
|
||||||
|
DankDropdown {
|
||||||
|
width: parent.width
|
||||||
|
text: I18n.tr("Mirror Display")
|
||||||
|
addHorizontalPadding: true
|
||||||
|
|
||||||
|
property var otherOutputs: {
|
||||||
|
const list = [I18n.tr("None")];
|
||||||
|
for (const name in DisplayConfigState.outputs) {
|
||||||
|
if (name !== root.outputName)
|
||||||
|
list.push(name);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
options: otherOutputs
|
||||||
|
|
||||||
|
currentValue: {
|
||||||
|
DisplayConfigState.pendingChanges;
|
||||||
|
const pending = DisplayConfigState.getPendingValue(root.outputName, "mirror");
|
||||||
|
const val = pending !== undefined ? pending : (root.outputData.mirror || "");
|
||||||
|
return val === "" ? I18n.tr("None") : val;
|
||||||
|
}
|
||||||
|
|
||||||
|
onValueChanged: value => {
|
||||||
|
const realVal = value === I18n.tr("None") ? "" : value;
|
||||||
|
DisplayConfigState.setPendingChange(root.outputName, "mirror", realVal);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DankToggle {
|
DankToggle {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
text: I18n.tr("10-bit Color")
|
text: I18n.tr("10-bit Color")
|
||||||
|
|||||||
@@ -56,6 +56,9 @@ Singleton {
|
|||||||
if (output.vrr_supported && output.vrr_enabled)
|
if (output.vrr_supported && output.vrr_enabled)
|
||||||
monitorLine += ", vrr, 1";
|
monitorLine += ", vrr, 1";
|
||||||
|
|
||||||
|
if (output.mirror && output.mirror.length > 0)
|
||||||
|
monitorLine += ", mirror, " + output.mirror;
|
||||||
|
|
||||||
if (outputSettings.bitdepth && outputSettings.bitdepth !== 8)
|
if (outputSettings.bitdepth && outputSettings.bitdepth !== 8)
|
||||||
monitorLine += ", bitdepth, " + outputSettings.bitdepth;
|
monitorLine += ", bitdepth, " + outputSettings.bitdepth;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user