From 09d4e2f1a1bc206c80d8d3287d070c70ec7fd63d Mon Sep 17 00:00:00 2001
From: chunhualin1 <chunhualin1@lenovo.com>
Date: 星期五, 14 八月 2026 20:00:52 +0800
Subject: [PATCH] Merge branch 'master' of http://git.linmoli.cn/r/Moli.Desktop
---
src/Moli.Desktop/Runtime/WidgetSessionOverlay.cs | 39 +++++++++++++++++++++++++++++++++++++++
1 files changed, 39 insertions(+), 0 deletions(-)
diff --git a/src/Moli.Desktop/Runtime/WidgetSessionOverlay.cs b/src/Moli.Desktop/Runtime/WidgetSessionOverlay.cs
new file mode 100644
index 0000000..9cf3360
--- /dev/null
+++ b/src/Moli.Desktop/Runtime/WidgetSessionOverlay.cs
@@ -0,0 +1,39 @@
+namespace Moli.Desktop.Runtime;
+
+/// <summary>In-memory per-widget overlay that never writes <c>layout.json</c>.</summary>
+public sealed record WidgetSessionOverlay
+{
+ public static WidgetSessionOverlay Empty { get; } = new();
+
+ public bool? Interactable { get; init; }
+ public bool? Visible { get; init; }
+
+ public bool HasInteractableOverride => Interactable is not null;
+ public bool HasVisibleOverride => Visible is not null;
+}
+
+/// <summary>Effective click-through / visibility rules used by runtime, surfaces and tests.</summary>
+public static class WidgetSurfaceRules
+{
+ public static bool ComputeClickThrough(
+ bool isEditMode,
+ bool isSafeInputMode,
+ WidgetSessionOverlay overlay,
+ bool layoutClickThrough)
+ {
+ if (isEditMode || isSafeInputMode)
+ {
+ return false;
+ }
+
+ if (overlay.Interactable is { } interactable)
+ {
+ return !interactable;
+ }
+
+ return layoutClickThrough;
+ }
+
+ public static bool ComputeVisible(WidgetSessionOverlay overlay, bool layoutVisible)
+ => overlay.Visible ?? layoutVisible;
+}
--
Gitblit v1.9.1