基于WebView2实现的Win11桌面框架,利用插件自定义
Moli
2026-05-05 4df6165fa93c7caeea86385312415e312de4d11f
src/Moli.Desktop/Api/LocalApiModels.cs
@@ -39,6 +39,7 @@
    public double? Opacity { get; init; }
    public bool? ClickThrough { get; init; }
    public double? Scale { get; init; }
    public DisplayLayer? DisplayLayer { get; init; }
    public WidgetLayoutPatch ToPatch() => new()
    {
@@ -48,7 +49,8 @@
        IsLocked = IsLocked,
        Opacity = Opacity,
        ClickThrough = ClickThrough,
        Scale = Scale
        Scale = Scale,
        DisplayLayer = DisplayLayer
    };
}
@@ -128,6 +130,8 @@
    public bool IsLocked { get; init; }
    public double Opacity { get; init; }
    public bool ClickThrough { get; init; }
    [JsonConverter(typeof(JsonStringEnumConverter<DisplayLayer>))]
    public DisplayLayer DisplayLayer { get; init; }
    public static WidgetResponse From(WidgetRuntimeState state) => new()
    {
@@ -138,7 +142,8 @@
        IsVisible = state.IsVisible,
        IsLocked = state.IsLocked,
        Opacity = state.Opacity,
        ClickThrough = state.ClickThrough
        ClickThrough = state.ClickThrough,
        DisplayLayer = state.DisplayLayer
    };
}