Move IconSourceConverter from TerminalApp to TSM

The Settings UI will need to take a dependency on IconSourceConverter.
This commit is contained in:
Leon Liang 2020-11-04 16:55:16 -08:00 committed by Dustin Howett
parent 219ee0c654
commit 2f9f103282
No known key found for this signature in database
GPG key ID: 0719BB71B334EE77
9 changed files with 21 additions and 15 deletions

View file

@ -5,6 +5,7 @@ the MIT License. See LICENSE in the project root for license information. -->
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:TerminalApp"
xmlns:model="using:Microsoft.Terminal.Settings.Model"
xmlns:mux="using:Microsoft.UI.Xaml.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@ -32,7 +33,7 @@ the MIT License. See LICENSE in the project root for license information. -->
<local:EmptyStringVisibilityConverter x:Key="CommandKeyChordVisibilityConverter"/>
<local:EmptyStringVisibilityConverter x:Key="ParentCommandVisibilityConverter"/>
<local:HasNestedCommandsVisibilityConverter x:Key="HasNestedCommandsVisibilityConverter"/>
<local:IconPathConverter x:Key="IconSourceConverter"/>
<model:IconPathConverter x:Key="IconSourceConverter"/>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Dark">

View file

@ -116,9 +116,6 @@
<ClInclude Include="HasNestedCommandsVisibilityConverter.h">
<DependentUpon>HasNestedCommandsVisibilityConverter.idl</DependentUpon>
</ClInclude>
<ClInclude Include="IconPathConverter.h">
<DependentUpon>IconPathConverter.idl</DependentUpon>
</ClInclude>
<ClInclude Include="Pane.h" />
<ClInclude Include="ColorHelper.h" />
<ClInclude Include="TerminalSettings.h">
@ -188,9 +185,6 @@
<ClCompile Include="HasNestedCommandsVisibilityConverter.cpp">
<DependentUpon>HasNestedCommandsVisibilityConverter.idl</DependentUpon>
</ClCompile>
<ClCompile Include="IconPathConverter.cpp">
<DependentUpon>IconPathConverter.idl</DependentUpon>
</ClCompile>
<ClCompile Include="Pane.cpp" />
<ClCompile Include="Pane.LayoutSizeNode.cpp" />
<ClCompile Include="ColorHelper.cpp" />
@ -271,7 +265,6 @@
<Midl Include="FilteredCommand.idl" />
<Midl Include="EmptyStringVisibilityConverter.idl" />
<Midl Include="HasNestedCommandsVisibilityConverter.idl" />
<Midl Include="IconPathConverter.idl" />
<Midl Include="TerminalSettings.idl" />
</ItemGroup>
<!-- ========================= Misc Files ======================== -->

View file

@ -7,7 +7,7 @@
using namespace winrt::Windows;
using namespace winrt::Windows::UI::Xaml;
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::Settings::Model::implementation
{
// These are templates that help us figure out which BitmapIconSource/FontIconSource to use for a given IconSource.
// We have to do this because some of our code still wants to use WUX/MUX IconSources.

View file

@ -3,7 +3,7 @@
#include "IconPathConverter.g.h"
#include "../inc/cppwinrt_utils.h"
namespace winrt::TerminalApp::implementation
namespace winrt::Microsoft::Terminal::Settings::Model::implementation
{
struct IconPathConverter : IconPathConverterT<IconPathConverter>
{
@ -24,7 +24,7 @@ namespace winrt::TerminalApp::implementation
};
}
namespace winrt::TerminalApp::factory_implementation
namespace winrt::Microsoft::Terminal::Settings::Model::factory_implementation
{
BASIC_FACTORY(IconPathConverter);
}

View file

@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
namespace TerminalApp
namespace Microsoft.Terminal.Settings.Model
{
// See https://docs.microsoft.com/en-us/windows/uwp/data-binding/data-binding-quickstart

View file

@ -16,6 +16,9 @@
<!-- ========================= Headers ======================== -->
<ItemGroup>
<ClInclude Include="IconPathConverter.h">
<DependentUpon>IconPathConverter.idl</DependentUpon>
</ClInclude>
<ClInclude Include="pch.h" />
<ClInclude Include="ActionArgs.h">
<DependentUpon>ActionArgs.idl</DependentUpon>
@ -59,6 +62,9 @@
</ItemGroup>
<!-- ========================= Cpp Files ======================== -->
<ItemGroup>
<ClCompile Include="IconPathConverter.cpp">
<DependentUpon>IconPathConverter.idl</DependentUpon>
</ClCompile>
<ClCompile Include="init.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
@ -114,6 +120,7 @@
<Midl Include="ColorScheme.idl" />
<Midl Include="Command.idl" />
<Midl Include="GlobalAppSettings.idl" />
<Midl Include="IconPathConverter.idl" />
<Midl Include="KeyMapping.idl" />
<Midl Include="Profile.idl" />
<Midl Include="TerminalWarnings.idl" />

View file

@ -28,11 +28,11 @@
<ClCompile Include="DefaultProfileUtils.cpp">
<Filter>profileGeneration</Filter>
</ClCompile>
<ClCompile Include="Utils.cpp" />
<ClCompile Include="$(OpenConsoleDir)\dep\jsoncpp\jsoncpp.cpp">
<Filter>json</Filter>
</ClCompile>
<ClCompile Include="init.cpp" />
<ClCompile Include="IconPathConverter.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
@ -56,13 +56,14 @@
<ClInclude Include="SettingsTypes.h" />
<ClInclude Include="TerminalWarnings.h" />
<ClInclude Include="ColorScheme.h" />
<ClInclude Include="Utils.h" />
<ClInclude Include="DefaultProfileUtils.h">
<Filter>profileGeneration</Filter>
</ClInclude>
<ClInclude Include="JsonUtils.h">
<Filter>json</Filter>
</ClInclude>
<ClInclude Include="IInheritable.h" />
<ClInclude Include="IconPathConverter.h" />
</ItemGroup>
<ItemGroup>
<Midl Include="ActionArgs.idl" />
@ -73,10 +74,11 @@
<Midl Include="Profile.idl" />
<Midl Include="TerminalWarnings.idl" />
<Midl Include="CascadiaSettings.idl" />
<Midl Include="KeyChordSerialization.idl" />
<Midl Include="IconPathConverter.idl" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="TerminalSettingsModel.def" />
</ItemGroup>
<ItemGroup>
<Filter Include="profileGeneration">

View file

@ -30,6 +30,7 @@
<ClInclude Include="../KeyMapping.h" />
<ClInclude Include="../Profile.h" />
<ClInclude Include="../TerminalWarnings.h" />
<ClInclude Include="../IconPathConverter.h" />
</ItemGroup>
<!-- ========================= Cpp Files ======================== -->
<!-- Don't put source files in here - put them in the lib's vcxproj instead! -->

View file

@ -38,6 +38,8 @@
#include <winrt/Windows.System.h>
#include <winrt/Microsoft.UI.Xaml.Controls.h>
// Including TraceLogging essentials for the binary
#include <TraceLoggingProvider.h>
#include <winmeta.h>