mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-13 05:34:47 +00:00
Merge pull request #911 from Denny09310/develop
feat: updated 'TitleBarOverlay' property to be passed as object
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using ElectronNET.Converter;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using System.ComponentModel;
|
||||
|
||||
@@ -216,10 +217,16 @@ namespace ElectronNET.API.Entities
|
||||
public TitleBarStyle TitleBarStyle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// When using a frameless window this can be used to indicate if the
|
||||
/// standard control buttons should be shown. Default is false.
|
||||
/// Configures the window's title bar overlay when using a frameless window.
|
||||
/// Can be either:
|
||||
/// - false: No title bar overlay.
|
||||
/// - true: Enables the default title bar overlay.
|
||||
/// - An object defining custom overlay options (such as height, color, etc.).
|
||||
///
|
||||
/// Default is false.
|
||||
/// </summary>
|
||||
public bool TitleBarOverlay { get; set; }
|
||||
[JsonConverter(typeof(TitleBarOverlayConverter))]
|
||||
public TitleBarOverlay TitleBarOverlay { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Shows the title in the tile bar in full screen mode on macOS for all
|
||||
|
||||
22
src/ElectronNET.API/API/Entities/TitleBarOverlay.cs
Normal file
22
src/ElectronNET.API/API/Entities/TitleBarOverlay.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
namespace ElectronNET.API.Entities;
|
||||
|
||||
public class TitleBarOverlay
|
||||
{
|
||||
private readonly bool? _value;
|
||||
|
||||
public TitleBarOverlay()
|
||||
{
|
||||
}
|
||||
|
||||
private TitleBarOverlay(bool value) : this() => _value = value;
|
||||
|
||||
public string Color { get; set; }
|
||||
|
||||
public double Height { get; set; }
|
||||
|
||||
public string SymbolColor { get; set; }
|
||||
|
||||
public static implicit operator bool?(TitleBarOverlay titleBarOverlay) => titleBarOverlay?._value;
|
||||
|
||||
public static implicit operator TitleBarOverlay(bool value) => new(value);
|
||||
}
|
||||
Reference in New Issue
Block a user