2025-11-22 02:16:10 +01:00
|
|
|
|
using System.Runtime.Versioning;
|
2025-11-08 11:14:33 +01:00
|
|
|
|
|
2025-11-22 02:16:10 +01:00
|
|
|
|
namespace ElectronNET.API.Entities;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Configures the window's title bar overlay when using a frameless window.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <remarks>Up-to-date with Electron API 39.2</remarks>
|
2025-11-08 11:14:33 +01:00
|
|
|
|
public class TitleBarOverlay
|
|
|
|
|
|
{
|
|
|
|
|
|
private readonly bool? _value;
|
|
|
|
|
|
|
2025-11-08 11:15:34 +01:00
|
|
|
|
public TitleBarOverlay()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private TitleBarOverlay(bool value) : this() => _value = value;
|
2025-11-08 11:14:33 +01:00
|
|
|
|
|
2025-11-22 02:16:10 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets or sets the CSS color of the Window Controls Overlay when enabled.
|
|
|
|
|
|
/// OS-specific per MCP: available on Windows and Linux.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[SupportedOSPlatform("windows")]
|
|
|
|
|
|
[SupportedOSPlatform("linux")]
|
2025-11-08 11:14:33 +01:00
|
|
|
|
public string Color { get; set; }
|
|
|
|
|
|
|
2025-11-22 02:16:10 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets or sets the height of the title bar and Window Controls Overlay in pixels. Default is system height.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int Height { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets or sets the CSS color of the symbols on the Window Controls Overlay when enabled.
|
|
|
|
|
|
/// OS-specific per MCP: available on Windows and Linux.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[SupportedOSPlatform("windows")]
|
|
|
|
|
|
[SupportedOSPlatform("linux")]
|
2025-11-08 11:14:33 +01:00
|
|
|
|
public string SymbolColor { get; set; }
|
|
|
|
|
|
|
2025-11-22 02:16:10 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Allows using a bare boolean for titleBarOverlay in options (true/false).
|
|
|
|
|
|
/// </summary>
|
2025-11-08 11:14:33 +01:00
|
|
|
|
public static implicit operator bool?(TitleBarOverlay titleBarOverlay) => titleBarOverlay?._value;
|
|
|
|
|
|
|
2025-11-22 02:16:10 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Allows constructing from a bare boolean (true/false) for titleBarOverlay.
|
|
|
|
|
|
/// </summary>
|
2025-11-08 11:14:33 +01:00
|
|
|
|
public static implicit operator TitleBarOverlay(bool value) => new(value);
|
2025-11-08 11:15:34 +01:00
|
|
|
|
}
|