saving the settings works again
This commit is contained in:
parent
4f7e883673
commit
a9de82e4ee
|
@ -125,7 +125,7 @@ NewTerminalArgs Pane::GetTerminalArgsForPane() const
|
|||
assert(_IsLeaf());
|
||||
|
||||
NewTerminalArgs args{};
|
||||
auto controlSettings = _control.Settings(); //.as<TerminalSettings>();
|
||||
auto controlSettings = _control.Settings();
|
||||
|
||||
args.Profile(controlSettings.ProfileName());
|
||||
// If we know the user's working directory use it instead of the profile.
|
||||
|
@ -1463,21 +1463,21 @@ void Pane::UpdateSettings(const TerminalSettingsCreateResult& settings, const Pr
|
|||
assert(_IsLeaf());
|
||||
|
||||
_profile = profile;
|
||||
auto controlSettings = _control.Settings().as<TerminalSettings>();
|
||||
// Update the parent of the control's settings object (and not the object itself) so
|
||||
// that any overrides made by the control don't get affected by the reload
|
||||
controlSettings.SetParent(settings.DefaultSettings());
|
||||
auto unfocusedSettings{ settings.UnfocusedSettings() };
|
||||
if (unfocusedSettings)
|
||||
{
|
||||
// Note: the unfocused settings needs to be entirely unchanged _except_ we need to
|
||||
// set its parent to the settings object that lives in the control. This is because
|
||||
// the overrides made by the control live in that settings object, so we want to make
|
||||
// sure the unfocused settings inherit from that.
|
||||
unfocusedSettings.SetParent(controlSettings);
|
||||
}
|
||||
// _control.UnfocusedAppearance(unfocusedSettings);
|
||||
_control.UpdateControlSettings(controlSettings, unfocusedSettings);
|
||||
// auto controlSettings = _control.Settings().as<TerminalSettings>();
|
||||
// // Update the parent of the control's settings object (and not the object itself) so
|
||||
// // that any overrides made by the control don't get affected by the reload
|
||||
// controlSettings.SetParent(settings.DefaultSettings());
|
||||
// auto unfocusedSettings{ settings.UnfocusedSettings() };
|
||||
// if (unfocusedSettings)
|
||||
// {
|
||||
// // Note: the unfocused settings needs to be entirely unchanged _except_ we need to
|
||||
// // set its parent to the settings object that lives in the control. This is because
|
||||
// // the overrides made by the control live in that settings object, so we want to make
|
||||
// // sure the unfocused settings inherit from that.
|
||||
// unfocusedSettings.SetParent(controlSettings);
|
||||
// }
|
||||
// // _control.UnfocusedAppearance(unfocusedSettings);
|
||||
_control.UpdateControlSettings(settings.DefaultSettings(), settings.UnfocusedSettings());
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
|
|
|
@ -2161,8 +2161,8 @@ namespace winrt::TerminalApp::implementation
|
|||
{
|
||||
// Give term control a child of the settings so that any overrides go in the child
|
||||
// This way, when we do a settings reload we just update the parent and the overrides remain
|
||||
const auto child = TerminalSettings::CreateWithParent(settings);
|
||||
TermControl term{ child.DefaultSettings(), child.UnfocusedSettings(), connection };
|
||||
// const auto child = TerminalSettings::CreateWithParent(settings);
|
||||
TermControl term{ settings.DefaultSettings(), settings.UnfocusedSettings(), connection };
|
||||
|
||||
// term.UnfocusedAppearance(child.UnfocusedSettings()); // It is okay for the unfocused settings to be null
|
||||
|
||||
|
|
|
@ -633,26 +633,33 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Updates the appearance of the current terminal.
|
||||
// - INVARIANT: This method can only be called if the caller DOES NOT HAVE writing lock on the terminal.
|
||||
void ControlCore::ApplyAppearance(const bool& focused)
|
||||
{
|
||||
auto lock = _terminal->LockForWriting();
|
||||
const auto& newAppearance{ focused ? _settings->FocusedAppearance() : _settings->UnfocusedAppearance() };
|
||||
// Update the terminal core with its new Core settings
|
||||
_terminal->UpdateAppearance(*newAppearance);
|
||||
|
||||
// Update DxEngine settings under the lock
|
||||
if (_renderEngine)
|
||||
{
|
||||
// Update DxEngine settings under the lock
|
||||
_renderEngine->SetSelectionBackground(til::color{ newAppearance->SelectionBackground() });
|
||||
_renderEngine->SetRetroTerminalEffect(newAppearance->RetroTerminalEffect());
|
||||
_renderEngine->SetPixelShaderPath(newAppearance->PixelShaderPath());
|
||||
_renderEngine->SetIntenseIsBold(_settings->IntenseIsBold());
|
||||
_renderer->TriggerRedrawAll();
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
// - Updates the appearance of the current terminal.
|
||||
// - INVARIANT: This method can only be called if the caller DOES NOT HAVE writing lock on the terminal.
|
||||
// void ControlCore::UpdateAppearance(const IControlAppearance& newAppearance)
|
||||
// {
|
||||
// auto lock = _terminal->LockForWriting();
|
||||
|
||||
// // Update the terminal core with its new Core settings
|
||||
// _terminal->UpdateAppearance(newAppearance);
|
||||
|
||||
// // Update DxEngine settings under the lock
|
||||
// if (_renderEngine)
|
||||
// {
|
||||
// // Update DxEngine settings under the lock
|
||||
// _renderEngine->SetSelectionBackground(til::color{ newAppearance.SelectionBackground() });
|
||||
// _renderEngine->SetRetroTerminalEffect(newAppearance.RetroTerminalEffect());
|
||||
// _renderEngine->SetPixelShaderPath(newAppearance.PixelShaderPath());
|
||||
// _renderEngine->SetIntenseIsBold(_settings->IntenseIsBold());
|
||||
// _renderer->TriggerRedrawAll();
|
||||
// }
|
||||
// }
|
||||
|
||||
void ControlCore::_updateAntiAliasingMode(::Microsoft::Console::Render::DxEngine* const dxEngine)
|
||||
|
|
|
@ -55,6 +55,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
void EnablePainting();
|
||||
|
||||
void UpdateSettings(const Control::IControlSettings& settings, const IControlAppearance& newAppearance);
|
||||
void ApplyAppearance(const bool& focused);
|
||||
// void UpdateAppearance(const Control::IControlAppearance& newAppearance);
|
||||
Control::IControlSettings Settings() const { return *_settings; };
|
||||
Control::IControlAppearance FocusedAppearance() const { return *_settings->FocusedAppearance(); };
|
||||
|
|
|
@ -42,6 +42,7 @@ namespace Microsoft.Terminal.Control
|
|||
|
||||
void UpdateSettings(IControlSettings settings, IControlAppearance appearance);
|
||||
// void UpdateAppearance(IControlAppearance appearance);
|
||||
void ApplyAppearance(Boolean focused);
|
||||
IControlSettings Settings { get; };
|
||||
IControlAppearance FocusedAppearance { get; };
|
||||
IControlAppearance UnfocusedAppearance { get; };
|
||||
|
|
|
@ -341,6 +341,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
|||
TSFInputControl().Foreground(foregroundBrush);
|
||||
|
||||
// TODO!
|
||||
_core.ApplyAppearance(_focused);
|
||||
// _core.UpdateAppearance(newAppearance.try_as<IControlAppearance>());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue