Refactor styles
This commit is contained in:
@@ -0,0 +1,9 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
@@ -15,6 +15,7 @@ namespace FileTime.ConsoleUI.App.UI
|
|||||||
IConsoleColor? SelectedItemBackground { get; }
|
IConsoleColor? SelectedItemBackground { get; }
|
||||||
IConsoleColor? SelectedItemForeground { get; }
|
IConsoleColor? SelectedItemForeground { get; }
|
||||||
IConsoleColor? ErrorColor { get; }
|
IConsoleColor? ErrorColor { get; }
|
||||||
|
IConsoleColor? ErrorInverseColor { get; }
|
||||||
IConsoleColor? AccentForeground { get; }
|
IConsoleColor? AccentForeground { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
13
src/FileTime.App.Style/FileTime.App.Style.csproj
Normal file
13
src/FileTime.App.Style/FileTime.App.Style.csproj
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\FileTime.App.Style.Abstraction\FileTime.App.Style.Abstraction.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
@@ -16,6 +16,7 @@ namespace FileTime.ConsoleUI.App.UI
|
|||||||
public IConsoleColor? SelectedItemForeground { get; }
|
public IConsoleColor? SelectedItemForeground { get; }
|
||||||
|
|
||||||
public IConsoleColor? ErrorColor { get; }
|
public IConsoleColor? ErrorColor { get; }
|
||||||
|
public IConsoleColor? ErrorInverseColor { get; }
|
||||||
public IConsoleColor? AccentForeground { get; }
|
public IConsoleColor? AccentForeground { get; }
|
||||||
|
|
||||||
public Styles(bool useAnsiColors)
|
public Styles(bool useAnsiColors)
|
||||||
@@ -29,6 +30,7 @@ namespace FileTime.ConsoleUI.App.UI
|
|||||||
ElementBackground = AnsiColor.From8bit(0);
|
ElementBackground = AnsiColor.From8bit(0);
|
||||||
|
|
||||||
ErrorColor = AnsiColor.From8bit(1);
|
ErrorColor = AnsiColor.From8bit(1);
|
||||||
|
ErrorInverseColor = AnsiColor.From8bit(15);
|
||||||
AccentForeground = AnsiColor.From8bit(2);
|
AccentForeground = AnsiColor.From8bit(2);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -40,6 +42,7 @@ namespace FileTime.ConsoleUI.App.UI
|
|||||||
SelectedItemForeground = new BasicColor(ConsoleColor.DarkYellow);
|
SelectedItemForeground = new BasicColor(ConsoleColor.DarkYellow);
|
||||||
|
|
||||||
ErrorColor = new BasicColor(ConsoleColor.Red);
|
ErrorColor = new BasicColor(ConsoleColor.Red);
|
||||||
|
ErrorInverseColor = new BasicColor(ConsoleColor.White);
|
||||||
AccentForeground = new BasicColor(ConsoleColor.Green);
|
AccentForeground = new BasicColor(ConsoleColor.Green);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\FileTime.Core\FileTime.Core.csproj" />
|
<ProjectReference Include="..\FileTime.Core\FileTime.Core.csproj" />
|
||||||
<ProjectReference Include="..\FileTime.App.Core\FileTime.App.Core.csproj" />
|
<ProjectReference Include="..\FileTime.App.Core\FileTime.App.Core.csproj" />
|
||||||
|
<ProjectReference Include="..\FileTime.App.Style.Abstraction\FileTime.App.Style.Abstraction.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
|
||||||
|
|||||||
@@ -232,8 +232,8 @@ namespace FileTime.ConsoleUI.App.UI
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_coloredRenderer.BackgroundColor = new BasicColor(ConsoleColor.Red);
|
_coloredRenderer.BackgroundColor = _appStyle.ErrorColor;
|
||||||
_coloredRenderer.ForegroundColor = new BasicColor(ConsoleColor.White);
|
_coloredRenderer.ForegroundColor = _appStyle.ErrorInverseColor;
|
||||||
Console.SetCursorPosition(startX, startY + currentY++);
|
Console.SetCursorPosition(startX, startY + currentY++);
|
||||||
|
|
||||||
_coloredRenderer.Write($"{{0,-{elementWidth}}}", _paddingLeft + "<empty>" + _paddingRight);
|
_coloredRenderer.Write($"{{0,-{elementWidth}}}", _paddingLeft + "<empty>" + _paddingRight);
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<ProjectReference Include="..\Providers\FileTime.Providers.Local\FileTime.Providers.Local.csproj" />
|
<ProjectReference Include="..\Providers\FileTime.Providers.Local\FileTime.Providers.Local.csproj" />
|
||||||
<ProjectReference Include="..\FileTime.ConsoleUI.App\FileTime.ConsoleUI.App.csproj" />
|
<ProjectReference Include="..\FileTime.ConsoleUI.App\FileTime.ConsoleUI.App.csproj" />
|
||||||
<ProjectReference Include="..\FileTime.App.Core\FileTime.App.Core.csproj" />
|
<ProjectReference Include="..\FileTime.App.Core\FileTime.App.Core.csproj" />
|
||||||
|
<ProjectReference Include="..\FileTime.App.Style\FileTime.App.Style.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0" />
|
||||||
|
|||||||
@@ -15,6 +15,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileTime.Providers.Local",
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileTime.App.Core", "FileTime.App.Core\FileTime.App.Core.csproj", "{2C0F630D-FD5D-4554-B8DD-F11BF4EB49C5}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileTime.App.Core", "FileTime.App.Core\FileTime.App.Core.csproj", "{2C0F630D-FD5D-4554-B8DD-F11BF4EB49C5}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileTime.App.Style", "FileTime.App.Style\FileTime.App.Style.csproj", "{92961CA3-ECAB-4920-95CA-F37E8F3EFDFA}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileTime.App.Style.Abstraction", "FileTime.App.Style.Abstraction\FileTime.App.Style.Abstraction.csproj", "{BEA824B0-7684-44FF-95BF-A75E92A36C9F}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@@ -48,6 +52,14 @@ Global
|
|||||||
{2C0F630D-FD5D-4554-B8DD-F11BF4EB49C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{2C0F630D-FD5D-4554-B8DD-F11BF4EB49C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{2C0F630D-FD5D-4554-B8DD-F11BF4EB49C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{2C0F630D-FD5D-4554-B8DD-F11BF4EB49C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{2C0F630D-FD5D-4554-B8DD-F11BF4EB49C5}.Release|Any CPU.Build.0 = Release|Any CPU
|
{2C0F630D-FD5D-4554-B8DD-F11BF4EB49C5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{92961CA3-ECAB-4920-95CA-F37E8F3EFDFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{92961CA3-ECAB-4920-95CA-F37E8F3EFDFA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{92961CA3-ECAB-4920-95CA-F37E8F3EFDFA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{92961CA3-ECAB-4920-95CA-F37E8F3EFDFA}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{BEA824B0-7684-44FF-95BF-A75E92A36C9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{BEA824B0-7684-44FF-95BF-A75E92A36C9F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{BEA824B0-7684-44FF-95BF-A75E92A36C9F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{BEA824B0-7684-44FF-95BF-A75E92A36C9F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(NestedProjects) = preSolution
|
GlobalSection(NestedProjects) = preSolution
|
||||||
{AAE01ED7-2E8B-40A2-AD0E-95BDA7C99272} = {517D96CE-A956-4638-A93D-465D34DE22B1}
|
{AAE01ED7-2E8B-40A2-AD0E-95BDA7C99272} = {517D96CE-A956-4638-A93D-465D34DE22B1}
|
||||||
|
|||||||
Reference in New Issue
Block a user