mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
fix(display): reactively update resolution when compositor reports changes. fix #1845
This commit is contained in:
@@ -24,7 +24,11 @@ PanelWindow {
|
||||
readonly property real barMarginH: (barFloating && edge === Settings.getBarPositionForScreen(screen?.name)) ? Math.ceil(Settings.data.bar.marginHorizontal) : 0
|
||||
readonly property real barMarginV: (barFloating && edge === Settings.getBarPositionForScreen(screen?.name)) ? Math.ceil(Settings.data.bar.marginVertical) : 0
|
||||
// Reduce exclusion zone by 1 physical pixel so app windows blend flush against the bar edge
|
||||
readonly property real bleedInset: 1.0 / (CompositorService.getDisplayScale(screen?.name) || 1.0)
|
||||
readonly property real bleedInset: {
|
||||
const info = CompositorService.displayScales[screen?.name];
|
||||
const scale = (info && info.scale) ? info.scale : 1.0;
|
||||
return 1.0 / scale;
|
||||
}
|
||||
|
||||
// Invisible - just reserves space
|
||||
color: "transparent"
|
||||
|
||||
@@ -218,6 +218,10 @@ SmartPanel {
|
||||
Layout.preferredHeight: outputColumn.implicitHeight + Style.margin2M
|
||||
|
||||
property var brightnessMonitor: BrightnessService.getMonitorForScreen(modelData)
|
||||
readonly property real compositorScale: {
|
||||
const info = CompositorService.displayScales[modelData.name];
|
||||
return (info && info.scale) ? info.scale : 1.0;
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
id: outputColumn
|
||||
@@ -231,7 +235,6 @@ SmartPanel {
|
||||
label: modelData.name || "Unknown"
|
||||
labelColor: Color.mPrimary
|
||||
description: {
|
||||
const compositorScale = CompositorService.getDisplayScale(modelData.name);
|
||||
I18n.tr("system.monitor-description", {
|
||||
"model": modelData.model,
|
||||
"width": modelData.width * compositorScale,
|
||||
|
||||
@@ -33,6 +33,10 @@ ColumnLayout {
|
||||
|
||||
required property var modelData
|
||||
readonly property string screenName: modelData.name || "Unknown"
|
||||
readonly property real compositorScale: {
|
||||
const info = CompositorService.displayScales[screenName];
|
||||
return (info && info.scale) ? info.scale : 1.0;
|
||||
}
|
||||
readonly property bool barEnabled: (Settings.data.bar.monitors || []).indexOf(screenName) !== -1
|
||||
readonly property bool hasOverride: Settings.hasScreenOverride(screenName)
|
||||
|
||||
@@ -67,12 +71,11 @@ ColumnLayout {
|
||||
|
||||
NText {
|
||||
text: {
|
||||
const compositorScale = CompositorService.getDisplayScale(monitorCard.screenName);
|
||||
return I18n.tr("system.monitor-description", {
|
||||
"model": monitorCard.modelData.model || I18n.tr("common.unknown"),
|
||||
"width": Math.round(monitorCard.modelData.width * compositorScale),
|
||||
"height": Math.round(monitorCard.modelData.height * compositorScale),
|
||||
"scale": compositorScale
|
||||
"width": Math.round(monitorCard.modelData.width * monitorCard.compositorScale),
|
||||
"height": Math.round(monitorCard.modelData.height * monitorCard.compositorScale),
|
||||
"scale": monitorCard.compositorScale
|
||||
});
|
||||
}
|
||||
pointSize: Style.fontSizeS
|
||||
|
||||
@@ -80,11 +80,14 @@ ColumnLayout {
|
||||
|
||||
NSectionEditor {
|
||||
required property var modelData
|
||||
readonly property real compositorScale: {
|
||||
const info = CompositorService.displayScales[modelData.name];
|
||||
return (info && info.scale) ? info.scale : 1.0;
|
||||
}
|
||||
|
||||
Layout.fillWidth: true
|
||||
sectionName: modelData.name
|
||||
sectionSubtitle: {
|
||||
var compositorScale = CompositorService.getDisplayScale(modelData.name);
|
||||
// Format scale to 2 decimal places to prevent overly long text
|
||||
var formattedScale = compositorScale.toFixed(2);
|
||||
return "(" + modelData.width + "x" + modelData.height + " @ " + formattedScale + "x)";
|
||||
|
||||
@@ -107,8 +107,11 @@ ColumnLayout {
|
||||
|
||||
NText {
|
||||
Layout.fillWidth: true
|
||||
readonly property real compositorScale: {
|
||||
const info = CompositorService.displayScales[modelData.name];
|
||||
return (info && info.scale) ? info.scale : 1.0;
|
||||
}
|
||||
text: {
|
||||
const compositorScale = CompositorService.getDisplayScale(modelData.name);
|
||||
I18n.tr("system.monitor-description", {
|
||||
"model": modelData.model,
|
||||
"width": modelData.width * compositorScale,
|
||||
|
||||
@@ -35,9 +35,12 @@ ColumnLayout {
|
||||
model: Quickshell.screens || []
|
||||
delegate: NCheckbox {
|
||||
Layout.fillWidth: true
|
||||
readonly property real compositorScale: {
|
||||
const info = CompositorService.displayScales[modelData.name];
|
||||
return (info && info.scale) ? info.scale : 1.0;
|
||||
}
|
||||
label: modelData.name || "Unknown"
|
||||
description: {
|
||||
const compositorScale = CompositorService.getDisplayScale(modelData.name);
|
||||
I18n.tr("system.monitor-description", {
|
||||
"model": modelData.model,
|
||||
"width": modelData.width * compositorScale,
|
||||
|
||||
@@ -35,9 +35,12 @@ ColumnLayout {
|
||||
model: Quickshell.screens || []
|
||||
delegate: NCheckbox {
|
||||
Layout.fillWidth: true
|
||||
readonly property real compositorScale: {
|
||||
const info = CompositorService.displayScales[modelData.name];
|
||||
return (info && info.scale) ? info.scale : 1.0;
|
||||
}
|
||||
label: modelData.name || "Unknown"
|
||||
description: {
|
||||
const compositorScale = CompositorService.getDisplayScale(modelData.name);
|
||||
I18n.tr("system.monitor-description", {
|
||||
"model": modelData.model,
|
||||
"width": modelData.width * compositorScale,
|
||||
|
||||
@@ -122,9 +122,12 @@ ColumnLayout {
|
||||
model: Quickshell.screens || []
|
||||
delegate: NCheckbox {
|
||||
Layout.fillWidth: true
|
||||
readonly property real compositorScale: {
|
||||
const info = CompositorService.displayScales[modelData.name];
|
||||
return (info && info.scale) ? info.scale : 1.0;
|
||||
}
|
||||
label: modelData.name || I18n.tr("common.unknown")
|
||||
description: {
|
||||
const compositorScale = CompositorService.getDisplayScale(modelData.name);
|
||||
I18n.tr("system.monitor-description", {
|
||||
"model": modelData.model,
|
||||
"width": modelData.width * compositorScale,
|
||||
|
||||
@@ -114,9 +114,12 @@ ColumnLayout {
|
||||
model: Quickshell.screens || []
|
||||
delegate: NCheckbox {
|
||||
Layout.fillWidth: true
|
||||
readonly property real compositorScale: {
|
||||
const info = CompositorService.displayScales[modelData.name];
|
||||
return (info && info.scale) ? info.scale : 1.0;
|
||||
}
|
||||
label: modelData.name || I18n.tr("common.unknown")
|
||||
description: {
|
||||
const compositorScale = CompositorService.getDisplayScale(modelData.name);
|
||||
I18n.tr("system.monitor-description", {
|
||||
"model": modelData.model,
|
||||
"width": modelData.width * compositorScale,
|
||||
|
||||
@@ -177,10 +177,13 @@ ColumnLayout {
|
||||
model: Quickshell.screens || []
|
||||
delegate: NCheckbox {
|
||||
Layout.fillWidth: true
|
||||
readonly property real compositorScale: {
|
||||
const info = CompositorService.displayScales[modelData.name];
|
||||
return (info && info.scale) ? info.scale : 1.0;
|
||||
}
|
||||
label: modelData.name || "Unknown"
|
||||
visible: Settings.data.dock.enabled
|
||||
description: {
|
||||
const compositorScale = CompositorService.getDisplayScale(modelData.name);
|
||||
I18n.tr("system.monitor-description", {
|
||||
"model": modelData.model,
|
||||
"width": modelData.width * compositorScale,
|
||||
|
||||
Reference in New Issue
Block a user