mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 07:47:54 +01:00
Make IDriver.Force16Colors get-only as per code review
- Changed IDriver.Force16Colors from get/set to get-only - Simplified DriverImpl.Force16Colors implementation to remove setter - Updated documentation to clarify Force16Colors is read-only per driver instance - Addresses code review feedback about inconsistent interface declaration Co-authored-by: tig <585482+tig@users.noreply.github.com>
This commit is contained in:
@@ -206,11 +206,7 @@ internal class DriverImpl : IDriver
|
||||
public bool SupportsTrueColor => true;
|
||||
|
||||
/// <inheritdoc/>
|
||||
bool IDriver.Force16Colors
|
||||
{
|
||||
get => _instanceForce16Colors || !SupportsTrueColor;
|
||||
set => throw new InvalidOperationException ("Force16Colors is read-only per driver instance. Set Terminal.Gui.Drivers.Driver.Force16Colors static property before driver creation.");
|
||||
}
|
||||
public bool Force16Colors => _instanceForce16Colors || !SupportsTrueColor;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool GetForce16Colors () => _instanceForce16Colors || !SupportsTrueColor;
|
||||
|
||||
@@ -93,8 +93,12 @@ public interface IDriver
|
||||
/// Will be forced to <see langword="true"/> if <see cref="IDriver.SupportsTrueColor"/> is
|
||||
/// <see langword="false"/>, indicating that the <see cref="IDriver"/> cannot support TrueColor.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// This property is read-only. To change the Force16Colors setting, set
|
||||
/// <c>Terminal.Gui.Drivers.Driver.Force16Colors</c> before creating the driver instance.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
bool Force16Colors { get; set; }
|
||||
bool Force16Colors { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets whether the <see cref="IDriver"/> is using 16 colors instead of TrueColors.
|
||||
|
||||
Reference in New Issue
Block a user