Skip to content

Commit

Permalink
remove TerminalSettings dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
carlos-zamora committed Aug 12, 2020
1 parent 0e460b2 commit 7a3ca00
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
14 changes: 7 additions & 7 deletions src/cascadia/TerminalApp/ColorScheme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,20 @@ ColorScheme::~ColorScheme()
// - Apply our values to the given TerminalSettings object. Sets the foreground,
// background, and color table of the settings object.
// Arguments:
// - terminalSettings: the object to apply our settings to.
// - settings: the object to apply our settings to.
// Return Value:
// - <none>
void ColorScheme::ApplyScheme(const winrt::Microsoft::Terminal::TerminalControl::IControlSettings& terminalSettings) const
void ColorScheme::ApplyScheme(const winrt::Microsoft::Terminal::TerminalControl::IControlSettings& settings) const
{
terminalSettings.DefaultForeground(static_cast<COLORREF>(_defaultForeground));
terminalSettings.DefaultBackground(static_cast<COLORREF>(_defaultBackground));
terminalSettings.SelectionBackground(static_cast<COLORREF>(_selectionBackground));
terminalSettings.CursorColor(static_cast<COLORREF>(_cursorColor));
settings.DefaultForeground(static_cast<COLORREF>(_defaultForeground));
settings.DefaultBackground(static_cast<COLORREF>(_defaultBackground));
settings.SelectionBackground(static_cast<COLORREF>(_selectionBackground));
settings.CursorColor(static_cast<COLORREF>(_cursorColor));

auto const tableCount = gsl::narrow_cast<int>(_table.size());
for (int i = 0; i < tableCount; i++)
{
terminalSettings.SetColorTableEntry(i, static_cast<COLORREF>(_table[i]));
settings.SetColorTableEntry(i, static_cast<COLORREF>(_table[i]));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/TerminalApp/ColorScheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace winrt::TerminalApp::implementation
ColorScheme(hstring name, Windows::UI::Color defaultFg, Windows::UI::Color defaultBg, Windows::UI::Color cursorColor);
~ColorScheme();

void ApplyScheme(const winrt::Microsoft::Terminal::TerminalControl::IControlSettings& terminalSettings) const;
void ApplyScheme(const winrt::Microsoft::Terminal::TerminalControl::IControlSettings& settings) const;

static com_ptr<ColorScheme> FromJson(const Json::Value& json);
bool ShouldBeLayered(const Json::Value& json) const;
Expand Down
4 changes: 1 addition & 3 deletions src/cascadia/TerminalApp/ColorScheme.idl
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import "../TerminalSettings.idl";

namespace TerminalApp
{
[default_interface] runtimeclass ColorScheme {
ColorScheme();
ColorScheme(String name, Windows.UI.Color defaultFg, Windows.UI.Color defaultBg, Windows.UI.Color cursorColor);

void ApplyScheme(Microsoft.Terminal.TerminalControl.IControlSettings terminalSettings);
void ApplyScheme(Microsoft.Terminal.TerminalControl.IControlSettings settings);

String Name { get; };

Expand Down

0 comments on commit 7a3ca00

Please sign in to comment.