The simple PR feedback
This commit is contained in:
parent
d51c2cff35
commit
9eeea4a9d0
|
@ -2126,8 +2126,9 @@ namespace winrt::TerminalApp::implementation
|
||||||
|
|
||||||
TermControl TerminalPage::_InitControl(const TerminalSettingsCreateResult& settings, const ITerminalConnection& connection)
|
TermControl TerminalPage::_InitControl(const TerminalSettingsCreateResult& settings, const ITerminalConnection& connection)
|
||||||
{
|
{
|
||||||
// Give term control a child of the settings so that any overrides go in the child
|
// Do any initialization that needs to apply to _every_ TermControl we
|
||||||
// This way, when we do a settings reload we just update the parent and the overrides remain
|
// create here.
|
||||||
|
// TermControl will copy the settings out of the settings passed to it.
|
||||||
TermControl term{ settings.DefaultSettings(), settings.UnfocusedSettings(), connection };
|
TermControl term{ settings.DefaultSettings(), settings.UnfocusedSettings(), connection };
|
||||||
return term;
|
return term;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,8 +29,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||||
public:
|
public:
|
||||||
winrt::Microsoft::Terminal::Core::Color GetColorTableEntry(int32_t index) noexcept
|
winrt::Microsoft::Terminal::Core::Color GetColorTableEntry(int32_t index) noexcept
|
||||||
{
|
{
|
||||||
return _runtimeColorTable.at(index) ? *_runtimeColorTable.at(index) :
|
return til::coalesce_value(_runtimeColorTable.at(index), _ColorTable.at(index));
|
||||||
_ColorTable.at(index);
|
|
||||||
}
|
}
|
||||||
void SetColorTableEntry(int32_t index,
|
void SetColorTableEntry(int32_t index,
|
||||||
winrt::Microsoft::Terminal::Core::Color color) noexcept
|
winrt::Microsoft::Terminal::Core::Color color) noexcept
|
||||||
|
|
|
@ -39,7 +39,7 @@ private: \
|
||||||
void name(const type newValue) { _runtime##name = newValue; } \
|
void name(const type newValue) { _runtime##name = newValue; } \
|
||||||
\
|
\
|
||||||
public: \
|
public: \
|
||||||
type name() const { return _runtime##name ? *_runtime##name : setting; }
|
type name() const { return til::coalesce_value(_runtime##name, setting); }
|
||||||
|
|
||||||
namespace winrt::Microsoft::Terminal::Control::implementation
|
namespace winrt::Microsoft::Terminal::Control::implementation
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
#include "SearchBoxControl.h"
|
#include "SearchBoxControl.h"
|
||||||
|
|
||||||
#include "ControlInteractivity.h"
|
#include "ControlInteractivity.h"
|
||||||
#include "ControlSettings.h"
|
|
||||||
|
|
||||||
namespace Microsoft::Console::VirtualTerminal
|
namespace Microsoft::Console::VirtualTerminal
|
||||||
{
|
{
|
||||||
|
|
|
@ -59,10 +59,10 @@ namespace Microsoft.Terminal.Core
|
||||||
|
|
||||||
Microsoft.Terminal.Core.Color CursorColor;
|
Microsoft.Terminal.Core.Color CursorColor;
|
||||||
|
|
||||||
// Table: A WinRT struct doesn't allow pointers (like an array) in
|
// Table: A WinRT struct doesn't allow pointers (READ: doesn't allow
|
||||||
// structs, but we very much would like this object to be a struct. So
|
// array members) in structs, but we very much would like this object to
|
||||||
// we'll call out each color individually. There's only 16, it's not
|
// be a struct. So we'll call out each color individually. There's only
|
||||||
// that bad.
|
// 16, it's not that bad.
|
||||||
Microsoft.Terminal.Core.Color Black;
|
Microsoft.Terminal.Core.Color Black;
|
||||||
Microsoft.Terminal.Core.Color Red;
|
Microsoft.Terminal.Core.Color Red;
|
||||||
Microsoft.Terminal.Core.Color Green;
|
Microsoft.Terminal.Core.Color Green;
|
||||||
|
|
|
@ -206,27 +206,6 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
||||||
_Opacity = appearance.Opacity();
|
_Opacity = appearance.Opacity();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Method Description:
|
|
||||||
// - Sets our parent to the provided TerminalSettings
|
|
||||||
// Arguments:
|
|
||||||
// - parent: our new parent
|
|
||||||
void TerminalSettings::SetParent(const Model::TerminalSettings& parent)
|
|
||||||
{
|
|
||||||
ClearParents();
|
|
||||||
com_ptr<TerminalSettings> parentImpl;
|
|
||||||
parentImpl.copy_from(get_self<TerminalSettings>(parent));
|
|
||||||
InsertParent(parentImpl);
|
|
||||||
}
|
|
||||||
|
|
||||||
Model::TerminalSettings TerminalSettings::GetParent()
|
|
||||||
{
|
|
||||||
if (_parents.size() > 0)
|
|
||||||
{
|
|
||||||
return *_parents.at(0);
|
|
||||||
}
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Method Description:
|
// Method Description:
|
||||||
// - Apply Profile settings, as well as any colors from our color scheme, if we have one.
|
// - Apply Profile settings, as well as any colors from our color scheme, if we have one.
|
||||||
// Arguments:
|
// Arguments:
|
||||||
|
|
|
@ -64,10 +64,6 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
||||||
const Model::NewTerminalArgs& newTerminalArgs,
|
const Model::NewTerminalArgs& newTerminalArgs,
|
||||||
const Control::IKeyBindings& keybindings);
|
const Control::IKeyBindings& keybindings);
|
||||||
|
|
||||||
Model::TerminalSettings GetParent();
|
|
||||||
|
|
||||||
void SetParent(const Model::TerminalSettings& parent);
|
|
||||||
|
|
||||||
void ApplyColorScheme(const Model::ColorScheme& scheme);
|
void ApplyColorScheme(const Model::ColorScheme& scheme);
|
||||||
|
|
||||||
// --------------------------- Core Settings ---------------------------
|
// --------------------------- Core Settings ---------------------------
|
||||||
|
|
|
@ -29,12 +29,14 @@ namespace Microsoft.Terminal.Settings.Model
|
||||||
static TerminalSettingsCreateResult CreateWithProfile(CascadiaSettings appSettings, Profile profile, Microsoft.Terminal.Control.IKeyBindings keybindings);
|
static TerminalSettingsCreateResult CreateWithProfile(CascadiaSettings appSettings, Profile profile, Microsoft.Terminal.Control.IKeyBindings keybindings);
|
||||||
static TerminalSettingsCreateResult CreateWithNewTerminalArgs(CascadiaSettings appSettings, NewTerminalArgs newTerminalArgs, Microsoft.Terminal.Control.IKeyBindings keybindings);
|
static TerminalSettingsCreateResult CreateWithNewTerminalArgs(CascadiaSettings appSettings, NewTerminalArgs newTerminalArgs, Microsoft.Terminal.Control.IKeyBindings keybindings);
|
||||||
|
|
||||||
void SetParent(TerminalSettings parent);
|
|
||||||
TerminalSettings GetParent();
|
TerminalSettings GetParent();
|
||||||
void ApplyColorScheme(ColorScheme scheme);
|
void ApplyColorScheme(ColorScheme scheme);
|
||||||
|
|
||||||
ColorScheme AppliedColorScheme;
|
ColorScheme AppliedColorScheme;
|
||||||
|
|
||||||
|
// The getters for these are already defined in IControlSettings. So
|
||||||
|
// we're just adding the setters here, because TerminalApp likes to be
|
||||||
|
// able to change these at runtime (e.g. when duplicating a pane).
|
||||||
String Commandline { set; };
|
String Commandline { set; };
|
||||||
String StartingDirectory { set; };
|
String StartingDirectory { set; };
|
||||||
String EnvironmentVariables { set; };
|
String EnvironmentVariables { set; };
|
||||||
|
|
Loading…
Reference in a new issue