mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-05-15 09:52:37 +12:00
Revert "Revert [Feature] Update to .NET 5 (#157), version 1.0.18.0"
This commit is contained in:
parent
6ca1cbaf5a
commit
2c16ade92f
|
@ -12,7 +12,7 @@ namespace SystemTrayMenu
|
|||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using Microsoft.Win32;
|
||||
using SkiaSharp;
|
||||
using Svg;
|
||||
using SystemTrayMenu.Properties;
|
||||
using SystemTrayMenu.UserInterface.FolderBrowseDialog;
|
||||
using SystemTrayMenu.Utilities;
|
||||
|
@ -259,12 +259,12 @@ namespace SystemTrayMenu
|
|||
htmlColorCodeIcons = Settings.Default.ColorIcons;
|
||||
}
|
||||
|
||||
AppColors.BitmapOpenFolder = ReadSvg(Properties.Resources.ic_fluent_folder_arrow_right_48_regular, htmlColorCodeIcons, 20);
|
||||
AppColors.BitmapPin = ReadSvg(Properties.Resources.ic_fluent_pin_48_regular, htmlColorCodeIcons, 20);
|
||||
AppColors.BitmapPinActive = ReadSvg(Properties.Resources.ic_fluent_pin_48_filled, htmlColorCodeIcons, 20);
|
||||
AppColors.BitmapSearch = ReadSvg(Properties.Resources.ic_fluent_search_48_regular, htmlColorCodeIcons, 20);
|
||||
AppColors.BitmapFoldersCount = ReadSvg(Properties.Resources.ic_fluent_folder_48_regular, htmlColorCodeIcons, 18);
|
||||
AppColors.BitmapFilesCount = ReadSvg(Properties.Resources.ic_fluent_document_48_regular, htmlColorCodeIcons, 18);
|
||||
AppColors.BitmapOpenFolder = ReadSvg(Properties.Resources.ic_fluent_folder_arrow_right_48_regular, htmlColorCodeIcons);
|
||||
AppColors.BitmapPin = ReadSvg(Properties.Resources.ic_fluent_pin_48_regular, htmlColorCodeIcons);
|
||||
AppColors.BitmapPinActive = ReadSvg(Properties.Resources.ic_fluent_pin_48_filled, htmlColorCodeIcons);
|
||||
AppColors.BitmapSearch = ReadSvg(Properties.Resources.ic_fluent_search_48_regular, htmlColorCodeIcons);
|
||||
AppColors.BitmapFoldersCount = ReadSvg(Properties.Resources.ic_fluent_folder_48_regular, htmlColorCodeIcons);
|
||||
AppColors.BitmapFilesCount = ReadSvg(Properties.Resources.ic_fluent_document_48_regular, htmlColorCodeIcons);
|
||||
|
||||
colorAndCode.HtmlColorCode = Settings.Default.ColorSearchField;
|
||||
colorAndCode.Color = Color.FromArgb(255, 255, 255);
|
||||
|
@ -428,36 +428,17 @@ namespace SystemTrayMenu
|
|||
}
|
||||
}
|
||||
|
||||
private static Bitmap ReadSvg(byte[] byteArray, string htmlColorCode, int size = 18)
|
||||
private static Bitmap ReadSvg(byte[] byteArray, string htmlColorCode)
|
||||
{
|
||||
int factorToMakeSharper = 2;
|
||||
size = (int)(size * factorToMakeSharper * Scaling.Factor);
|
||||
string str = Encoding.UTF8.GetString(byteArray);
|
||||
str = str.Replace("#585858", htmlColorCode);
|
||||
byteArray = Encoding.UTF8.GetBytes(str);
|
||||
|
||||
using (var stream = new MemoryStream(byteArray))
|
||||
{
|
||||
var bitmap = new SKBitmap(size, size);
|
||||
var canvas = new SKCanvas(bitmap);
|
||||
canvas.Clear(SKColors.Transparent);
|
||||
|
||||
// load the SVG
|
||||
var svg = new SkiaSharp.Extended.Svg.SKSvg(new SKSize(size, size));
|
||||
svg.Load(stream);
|
||||
|
||||
// draw the SVG to the bitmap
|
||||
canvas.DrawPicture(svg.Picture);
|
||||
SKImage sKImage = SKImage.FromBitmap(bitmap);
|
||||
|
||||
SKData skData = sKImage.Encode(SKEncodedImageFormat.Png, 100);
|
||||
|
||||
using (var ms = new MemoryStream())
|
||||
{
|
||||
skData.SaveTo(ms);
|
||||
ms.Position = 0;
|
||||
return new Bitmap(ms);
|
||||
}
|
||||
var svgDocument = SvgDocument.Open<SvgDocument>(stream);
|
||||
svgDocument.Color = new SvgColourServer(Color.Black);
|
||||
return svgDocument.Draw();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,16 +1,28 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<RuntimeIdentifiers>win-x64</RuntimeIdentifiers>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x64</Platform>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<UseApplicationTrust>true</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<Platforms>x64;x86;AnyCPU</Platforms>
|
||||
<Configurations>Debug;Release;ReleasePackage</Configurations>
|
||||
<RootNamespace>SystemTrayMenu</RootNamespace>
|
||||
<AssemblyName>SystemTrayMenu</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<StartupObject>SystemTrayMenu.Program</StartupObject>
|
||||
|
@ -121,47 +133,47 @@
|
|||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
</Compile>
|
||||
<Compile Update="Resources\lang.it-IT.Designer.cs">
|
||||
<Compile Update="Resources\lang.it-IT.Designer.cs">
|
||||
<DependentUpon>lang.it-IT.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
</Compile>
|
||||
<Compile Update="Resources\lang.nl-NL.Designer.cs">
|
||||
<Compile Update="Resources\lang.nl-NL.Designer.cs">
|
||||
<DependentUpon>lang.nl-NL.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
</Compile>
|
||||
<Compile Update="Resources\lang.pt-BR.Designer.cs">
|
||||
<Compile Update="Resources\lang.pt-BR.Designer.cs">
|
||||
<DependentUpon>lang.pt-BR.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
</Compile>
|
||||
<Compile Update="Resources\lang.cs-CZ.Designer.cs">
|
||||
<Compile Update="Resources\lang.cs-CZ.Designer.cs">
|
||||
<DependentUpon>lang.cs-CZ.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
</Compile>
|
||||
<Compile Update="Resources\lang.zh-CN.Designer.cs">
|
||||
<Compile Update="Resources\lang.zh-CN.Designer.cs">
|
||||
<DependentUpon>lang.zh-CN.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
</Compile>
|
||||
<Compile Update="Resources\lang.ja-JP.Designer.cs">
|
||||
<Compile Update="Resources\lang.ja-JP.Designer.cs">
|
||||
<DependentUpon>lang.ja-JP.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
</Compile>
|
||||
<Compile Update="Resources\lang.ko-KR.Designer.cs">
|
||||
<Compile Update="Resources\lang.ko-KR.Designer.cs">
|
||||
<DependentUpon>lang.ko-KR.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
</Compile>
|
||||
<Compile Update="Resources\lang.ru-RU.Designer.cs">
|
||||
<Compile Update="Resources\lang.ru-RU.Designer.cs">
|
||||
<DependentUpon>lang.ru-RU.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
</Compile>
|
||||
<Compile Update="Resources\lang.vi-VN.Designer.cs">
|
||||
<Compile Update="Resources\lang.vi-VN.Designer.cs">
|
||||
<DependentUpon>lang.vi-VN.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
|
@ -195,19 +207,19 @@
|
|||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>lang.es-ES.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Update="Resources\lang.it-IT.resx">
|
||||
<EmbeddedResource Update="Resources\lang.it-IT.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>lang.it-IT.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Update="Resources\lang.nl-NL.resx">
|
||||
<EmbeddedResource Update="Resources\lang.nl-NL.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>lang.nl-NL.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Update="Resources\lang.pt-BR.resx">
|
||||
<EmbeddedResource Update="Resources\lang.pt-BR.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>lang.pt-BR.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Update="Resources\lang.cs-CZ.resx">
|
||||
<EmbeddedResource Update="Resources\lang.cs-CZ.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>lang.cs-CZ.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
|
@ -248,16 +260,28 @@
|
|||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</COMReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Microsoft .NET Framework 4.7.2 %28x86 and x64%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="5.0.3">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="SkiaSharp.Svg" Version="1.60.0" />
|
||||
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Svg" Version="3.2.3" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Packaging\AppPackages\" />
|
||||
|
|
|
@ -11,6 +11,7 @@ namespace SystemTrayMenu.UserInterface
|
|||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Windows.Forms;
|
||||
using Svg;
|
||||
using SystemTrayMenu.DataClasses;
|
||||
using SystemTrayMenu.DllImports;
|
||||
using SystemTrayMenu.Helpers;
|
||||
|
|
Loading…
Reference in a new issue