Skip to content

Commit

Permalink
more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
PankajBhojwani committed Apr 1, 2021
1 parent af0b227 commit 40ef35f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/cascadia/TerminalApp/Pane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,10 @@ void Pane::UpdateSettings(const TerminalSettingsCreateResult& settings, const GU
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(_control.Settings().as<TerminalSettings>());
}
_control.UnfocusedAppearance(unfocusedSettings);
Expand Down
3 changes: 1 addition & 2 deletions src/cascadia/TerminalSettingsModel/Profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,12 @@ void Profile::InsertParentHelper(winrt::com_ptr<Profile> child, winrt::com_ptr<P
if (index)
{
child->InsertParent(index.value(), parent);
child->_FinalizeInheritance();
}
else
{
child->InsertParent(parent);
child->_FinalizeInheritance();
}
child->_FinalizeInheritance();
}

// Method Description:
Expand Down
9 changes: 9 additions & 0 deletions src/cascadia/TerminalSettingsModel/TerminalSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,15 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
// - Creates a TerminalSettingsCreateResult from a parent TerminalSettingsCreateResult
// - The returned defaultSettings inherits from the parent's defaultSettings, and the
// returned unfocusedSettings inherits from the returned defaultSettings
// - Note that the unfocused settings needs to be entirely unchanged _except_ we need to
// set its parent to the other settings object that we return. This is because the overrides
// made by the control will live in that other settings object, so we want to make
// sure the unfocused settings inherit from that.
// - Another way to think about this is that initially we have UnfocusedSettings inherit
// from DefaultSettings. This function simply adds another TerminalSettings object
// in the middle of these two, so UnfocusedSettings now inherits from the new object
// and the new object inherits from the DefaultSettings. And this new object is what
// the control can put overrides in.
// Arguments:
// - parent: the TerminalSettingsCreateResult that we create a new one from
// Return Value:
Expand Down

0 comments on commit 40ef35f

Please sign in to comment.