turns out this _was_ overkill
This commit is contained in:
parent
a9e706c573
commit
1a7649ce21
|
@ -22,20 +22,15 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||||
// Color Table is special because it's an array
|
// Color Table is special because it's an array
|
||||||
std::array<winrt::Microsoft::Terminal::Core::Color, COLOR_TABLE_SIZE> _ColorTable;
|
std::array<winrt::Microsoft::Terminal::Core::Color, COLOR_TABLE_SIZE> _ColorTable;
|
||||||
|
|
||||||
// Color table is _extra_ special because each individual color is
|
|
||||||
// overridable, not the whole array.
|
|
||||||
// TODO! Pretty sure this is overkill, or never actually used. Remove?
|
|
||||||
std::array<std::optional<winrt::Microsoft::Terminal::Core::Color>, COLOR_TABLE_SIZE> _runtimeColorTable;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
winrt::Microsoft::Terminal::Core::Color GetColorTableEntry(int32_t index) noexcept
|
winrt::Microsoft::Terminal::Core::Color GetColorTableEntry(int32_t index) noexcept
|
||||||
{
|
{
|
||||||
return til::coalesce_value(_runtimeColorTable.at(index), _ColorTable.at(index));
|
return _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
|
||||||
{
|
{
|
||||||
_runtimeColorTable.at(index) = color;
|
_ColorTable.at(index) = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
ControlAppearance(Control::IControlAppearance appearance)
|
ControlAppearance(Control::IControlAppearance appearance)
|
||||||
|
|
|
@ -1650,6 +1650,16 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Method Description:
|
||||||
|
// - Apply the given color scheme to this control. We'll take the colors out
|
||||||
|
// of it and apply them to our focused appearance, and update the terminal
|
||||||
|
// buffer with the new color table.
|
||||||
|
// - This is here to support the Set Color Scheme action, and the ability to
|
||||||
|
// preview schemes in the control.
|
||||||
|
// Arguments:
|
||||||
|
// - scheme: the collection of colors to apply.
|
||||||
|
// Return Value:
|
||||||
|
// - <none>
|
||||||
void ControlCore::ColorScheme(const Core::Scheme& scheme)
|
void ControlCore::ColorScheme(const Core::Scheme& scheme)
|
||||||
{
|
{
|
||||||
auto l{ _terminal->LockForWriting() };
|
auto l{ _terminal->LockForWriting() };
|
||||||
|
|
Loading…
Reference in a new issue