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 {
|
||||
id: root
|
||||
|
||||
readonly property bool hasOutputBackend: WlrOutputService.wlrOutputAvailable
|
||||
readonly property bool hasOutputBackend: WlrOutputService.wlrOutputAvailable
|
||||
readonly property var wlrOutputs: WlrOutputService.outputs
|
||||
property var outputs: ({})
|
||||
property var savedOutputs: ({})
|
||||
@@ -238,6 +238,11 @@ Singleton {
|
||||
if (sdrSaturationMatch)
|
||||
sdrSaturation = parseFloat(sdrSaturationMatch[1]);
|
||||
|
||||
let mirror = "";
|
||||
const mirrorMatch = rest.match(/,\s*mirror,\s*([^,\s]+)/);
|
||||
if (mirrorMatch)
|
||||
mirror = mirrorMatch[1];
|
||||
|
||||
result[name] = {
|
||||
"name": name,
|
||||
"logical": {
|
||||
@@ -261,7 +266,8 @@ Singleton {
|
||||
"colorManagement": cm,
|
||||
"sdrBrightness": sdrBrightness,
|
||||
"sdrSaturation": sdrSaturation
|
||||
}
|
||||
},
|
||||
"mirror": mirror
|
||||
};
|
||||
}
|
||||
return result;
|
||||
@@ -573,6 +579,8 @@ Singleton {
|
||||
result[outputName].logical.transform = changes.transform;
|
||||
if (changes.vrr !== undefined)
|
||||
result[outputName].vrr_enabled = changes.vrr;
|
||||
if (changes.mirror !== undefined)
|
||||
result[outputName].mirror = changes.mirror;
|
||||
}
|
||||
return normalizeOutputPositions(result);
|
||||
}
|
||||
|
||||
@@ -71,6 +71,34 @@ Column {
|
||||
}
|
||||
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 {
|
||||
width: parent.width
|
||||
text: I18n.tr("10-bit Color")
|
||||
|
||||
Reference in New Issue
Block a user