This repository has been archived by the owner on May 5, 2020. It is now read-only.
forked from File-New-Project/EarTrumpet
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nho Quy Dinh
committed
Jul 31, 2019
1 parent
58e036e
commit f159cf0
Showing
105 changed files
with
3,190 additions
and
1,323 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,16 @@ | ||
# Compiling EarTrumpet | ||
|
||
## Requirements | ||
|
||
* [Visual Studio 2017](https://visualstudio.microsoft.com/vs/community/) (or newer) | ||
* [Git for Windows](https://git-scm.com/download/win) | ||
* [Windows 10 Anniversary Update](https://blogs.windows.com/windowsexperience/2016/08/02/how-to-get-the-windows-10-anniversary-update/#GD97Eq04wJA7S4P7.97) (or newer) | ||
* [.NET Framework 4.6.2 Developer Pack](https://www.microsoft.com/net/download/thank-you/net462-developer-pack) | ||
|
||
## Step-by-step | ||
|
||
1. Install Visual Studio 2017 with the `.NET desktop development` and `Universal Windows Platform development` workloads. Ensure the optional `Windows 10 SDK (10.0.14393.0)` component is also selected. | ||
|
||
2. Install the .NET Framework 4.6.2 Developer Pack. | ||
|
||
3. Install Git for Windows. | ||
|
||
4. Clone the EarTrumpet repository (`git clone https://github.com/File-New-Project/EarTrumpet.git`). | ||
|
||
5. Open `EarTrumpet.vs15.sln` in Visual Studio. | ||
|
||
6. If asked to re-target the `EarTrumpet.UWP` project, select `Windows 10 Anniversary Edition (10.0; Build 14393)`. This is a bug we will clear up soon. | ||
|
||
7. Change the target platform to `x86` and build the `EarTrumpet.Package` project. This should trigger the one-time installation of the `Microsoft.Services.Store.Engagement` Nuget package and build all dependent projects. | ||
|
||
8. You're done. If you plan on submitting your changes to us, please review the [Contributing guide](https://github.com/File-New-Project/EarTrumpet/blob/master/CONTRIBUTING.md) first. | ||
6. Change the target platform to `x86` and build the `EarTrumpet.Package` project. | ||
7. You're done. If you plan on submitting your changes to us, please review the [Contributing guide](https://github.com/File-New-Project/EarTrumpet/blob/master/CONTRIBUTING.md) first. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/> | ||
</startup> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<Application x:Class="EarTrumpet.ColorTool.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="clr-namespace:EarTrumpet.ColorTool" | ||
StartupUri="MainWindow.xaml"> | ||
<Application.Resources /> | ||
</Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using System.Windows; | ||
|
||
namespace EarTrumpet.ColorTool | ||
{ | ||
public partial class App : Application | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System.Windows.Media; | ||
|
||
namespace EarTrumpet.ColorTool | ||
{ | ||
public class ColorItemViewModel | ||
{ | ||
public ColorItemViewModel() { } | ||
|
||
public string Name { get; set; } | ||
public string Opacity { get; set; } | ||
public SolidColorBrush Color { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
using EarTrumpet.Interop.Helpers; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Media; | ||
|
||
namespace EarTrumpet.ColorTool | ||
{ | ||
public class ColorViewModel : BindableBase | ||
{ | ||
public IEnumerable<ColorItemViewModel> Colors { get; private set; } | ||
|
||
public ColorViewModel() | ||
{ | ||
Refresh(); | ||
} | ||
|
||
public void OnTextChanged(object sender, TextChangedEventArgs e) | ||
{ | ||
Refresh(((TextBox)sender).Text); | ||
} | ||
|
||
public void Refresh(string search = null) | ||
{ | ||
var colors = new List<ColorItemViewModel>(); | ||
|
||
if (SystemParameters.HighContrast) | ||
{ | ||
colors.Add(new ColorItemViewModel { Color = SystemColors.ActiveBorderBrush, Name = "ActiveBorderBrush" }); | ||
colors.Add(new ColorItemViewModel { Color = SystemColors.ActiveCaptionBrush, Name = "ActiveCaptionBrush" }); | ||
colors.Add(new ColorItemViewModel { Color = SystemColors.AppWorkspaceBrush, Name = "AppWorkspaceBrush" }); | ||
colors.Add(new ColorItemViewModel { Color = SystemColors.ControlBrush, Name = "ControlBrush" }); | ||
colors.Add(new ColorItemViewModel { Color = SystemColors.ControlDarkBrush, Name = "ControlDarkBrush" }); | ||
colors.Add(new ColorItemViewModel { Color = SystemColors.ControlDarkDarkBrush, Name = "ControlDarkDarkBrush" }); | ||
colors.Add(new ColorItemViewModel { Color = SystemColors.ControlLightBrush, Name = "ControlLightBrush" }); | ||
colors.Add(new ColorItemViewModel { Color = SystemColors.ControlLightLightBrush, Name = "ControlLightLightBrush" }); | ||
colors.Add(new ColorItemViewModel { Color = SystemColors.ControlTextBrush, Name = "ControlTextBrush" }); | ||
colors.Add(new ColorItemViewModel { Color = SystemColors.DesktopBrush, Name = "DesktopBrush" }); | ||
colors.Add(new ColorItemViewModel { Color = SystemColors.GradientActiveCaptionBrush, Name = "GradientActiveCaptionBrush" }); | ||
colors.Add(new ColorItemViewModel { Color = SystemColors.GradientInactiveCaptionBrush, Name = "GradientInactiveCaptionBrush" }); | ||
colors.Add(new ColorItemViewModel { Color = SystemColors.GrayTextBrush, Name = "GrayTextBrush" }); | ||
colors.Add(new ColorItemViewModel { Color = SystemColors.HighlightBrush, Name = "HighlightBrush" }); | ||
colors.Add(new ColorItemViewModel { Color = SystemColors.HighlightTextBrush, Name = "HighlightTextBrush" }); | ||
colors.Add(new ColorItemViewModel { Color = SystemColors.HotTrackBrush, Name = "HotTrackBrush" }); | ||
colors.Add(new ColorItemViewModel { Color = SystemColors.InactiveBorderBrush, Name = "InactiveBorderBrush" }); | ||
colors.Add(new ColorItemViewModel { Color = SystemColors.InactiveCaptionBrush, Name = "InactiveCaptionBrush" }); | ||
colors.Add(new ColorItemViewModel { Color = SystemColors.InactiveSelectionHighlightBrush, Name = "InactiveSelectionHighlightBrush" }); | ||
colors.Add(new ColorItemViewModel { Color = SystemColors.InactiveSelectionHighlightTextBrush, Name = "InactiveSelectionHighlightTextBrush" }); | ||
colors.Add(new ColorItemViewModel { Color = SystemColors.InfoBrush, Name = "InfoBrush" }); | ||
colors.Add(new ColorItemViewModel { Color = SystemColors.InfoTextBrush, Name = "InfoTextBrush" }); | ||
colors.Add(new ColorItemViewModel { Color = SystemColors.MenuBarBrush, Name = "MenuBarBrush" }); | ||
colors.Add(new ColorItemViewModel { Color = SystemColors.MenuBrush, Name = "MenuBrush" }); | ||
colors.Add(new ColorItemViewModel { Color = SystemColors.MenuHighlightBrush, Name = "MenuHighlightBrush" }); | ||
colors.Add(new ColorItemViewModel { Color = SystemColors.MenuTextBrush, Name = "MenuTextBrush" }); | ||
colors.Add(new ColorItemViewModel { Color = SystemColors.ScrollBarBrush, Name = "ScrollBarBrush" }); | ||
colors.Add(new ColorItemViewModel { Color = SystemColors.WindowBrush, Name = "WindowBrush" }); | ||
colors.Add(new ColorItemViewModel { Color = SystemColors.WindowFrameBrush, Name = "WindowFrameBrush" }); | ||
colors.Add(new ColorItemViewModel { Color = SystemColors.WindowTextBrush, Name = "WindowTextBrush" }); | ||
} | ||
else | ||
{ | ||
foreach (var c in ImmersiveSystemColors.GetList().OrderBy(d => d.Key)) | ||
{ | ||
if (!string.IsNullOrWhiteSpace(search)) | ||
{ | ||
if (!c.Key.ToLower().Contains(search.ToLower())) continue; | ||
} | ||
|
||
// Exclude junk UI-specific colors that are stale anyway. | ||
if (c.Key.Contains("Boot")) continue; | ||
if (c.Key.Contains("Start")) continue; | ||
if (c.Key.Contains("Hardware")) continue; | ||
if (c.Key.Contains("Files")) continue; | ||
if (c.Key.Contains("Multitasking")) continue; | ||
|
||
var color = c.Value; | ||
// color.A = 255; // Very misleading to render on white otherwise! | ||
colors.Add(new ColorItemViewModel { Color = new SolidColorBrush(color), Opacity = $"{Math.Round(((float)color.A / 255) * 100, 0)}%", Name = c.Key }); | ||
} | ||
} | ||
|
||
Colors = colors; | ||
RaisePropertyChanged(nameof(Colors)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{E5B2C3B5-4CED-4C82-8A82-D290A7E0FC5D}</ProjectGuid> | ||
<OutputType>WinExe</OutputType> | ||
<RootNamespace>EarTrumpet.ColorTool</RootNamespace> | ||
<AssemblyName>EarTrumpet.ColorTool</AssemblyName> | ||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion> | ||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> | ||
<Prefer32Bit>true</Prefer32Bit> | ||
<PlatformTarget>x86</PlatformTarget> | ||
<ErrorReport>prompt</ErrorReport> | ||
<FileAlignment>512</FileAlignment> | ||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> | ||
<WarningLevel>4</WarningLevel> | ||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> | ||
<TargetFrameworkProfile /> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> | ||
<DebugSymbols>true</DebugSymbols> | ||
<OutputPath>..\Build\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<DebugType>full</DebugType> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> | ||
<OutputPath>..\Build\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<Optimize>true</Optimize> | ||
<DebugType>pdbonly</DebugType> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Xml" /> | ||
<Reference Include="Microsoft.CSharp" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Xaml"> | ||
<RequiredTargetFramework>4.0</RequiredTargetFramework> | ||
</Reference> | ||
<Reference Include="WindowsBase" /> | ||
<Reference Include="PresentationCore" /> | ||
<Reference Include="PresentationFramework" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ApplicationDefinition Include="App.xaml"> | ||
<Generator>MSBuild:Compile</Generator> | ||
<SubType>Designer</SubType> | ||
</ApplicationDefinition> | ||
<Page Include="MainWindow.xaml"> | ||
<Generator>MSBuild:Compile</Generator> | ||
<SubType>Designer</SubType> | ||
</Page> | ||
<Compile Include="App.xaml.cs"> | ||
<DependentUpon>App.xaml</DependentUpon> | ||
<SubType>Code</SubType> | ||
</Compile> | ||
<Compile Include="ColorItemViewModel.cs" /> | ||
<Compile Include="ColorViewModel.cs" /> | ||
<Compile Include="MainWindow.xaml.cs"> | ||
<DependentUpon>MainWindow.xaml</DependentUpon> | ||
<SubType>Code</SubType> | ||
</Compile> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="Properties\AssemblyInfo.cs"> | ||
<SubType>Code</SubType> | ||
</Compile> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="App.config" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\EarTrumpet\EarTrumpet.csproj"> | ||
<Project>{ba3c7b42-84b0-468c-8640-217e2a24cf81}</Project> | ||
<Name>EarTrumpet</Name> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<Window x:Class="EarTrumpet.ColorTool.MainWindow" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:Event="clr-namespace:EarTrumpet.Extensions.EventBinding;assembly=EarTrumpet" | ||
xmlns:local="clr-namespace:EarTrumpet.ColorTool" | ||
Title="Color Viewer" | ||
Width="800" | ||
Height="450" | ||
WindowStartupLocation="CenterScreen"> | ||
<Window.DataContext> | ||
<local:ColorViewModel /> | ||
</Window.DataContext> | ||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="*" /> | ||
</Grid.RowDefinitions> | ||
<TextBox TextChanged="{Event:Binding OnTextChanged}" /> | ||
<ListView Grid.Row="1" ItemsSource="{Binding Colors}"> | ||
<ListView.ItemTemplate> | ||
<DataTemplate DataType="local:ColorItemViewModel"> | ||
<StackPanel Height="14" Orientation="Horizontal"> | ||
<TextBlock Width="30" | ||
VerticalAlignment="Center" | ||
Text="{Binding Opacity}" /> | ||
<Border Width="40" | ||
Height="14" | ||
Background="{Binding Color}" /> | ||
<TextBlock VerticalAlignment="Center" Text="{Binding Name}" /> | ||
</StackPanel> | ||
</DataTemplate> | ||
</ListView.ItemTemplate> | ||
</ListView> | ||
</Grid> | ||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System.Windows; | ||
|
||
namespace EarTrumpet.ColorTool | ||
{ | ||
public partial class MainWindow : Window | ||
{ | ||
public MainWindow() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System.Reflection; | ||
using System.Runtime.InteropServices; | ||
using System.Windows; | ||
|
||
[assembly: AssemblyTitle("EarTrumpet.ColorTool")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("EarTrumpet.ColorTool")] | ||
[assembly: AssemblyCopyright("")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
[assembly: ComVisible(false)] | ||
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] | ||
[assembly: AssemblyVersion("0.0.0.0")] | ||
[assembly: AssemblyFileVersion("0.0.0.0")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.