基于WebView2实现的Win11桌面框架,利用插件自定义
chunhualin1
2026-08-12 97df0fb5ed49e37d1c8e0e62057bb72ba5c9eb6a
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
    };
}