22
22
#include " ColorHelper.h"
23
23
#include " DebugTapConnection.h"
24
24
#include " SettingsTab.h"
25
+ #include " SettingsPaneContent.h"
25
26
#include " TabRowControl.h"
26
27
#include " Utils.h"
27
28
@@ -2264,6 +2265,8 @@ namespace winrt::TerminalApp::implementation
2264
2265
const float splitSize,
2265
2266
std::shared_ptr<Pane> newPane)
2266
2267
{
2268
+ // TODO! Prevent splitting the _settingsTab!
2269
+
2267
2270
// If the caller is calling us with the return value of _MakePane
2268
2271
// directly, it's possible that nullptr was returned, if the connections
2269
2272
// was supposed to be launched in an elevated window. In that case, do
@@ -3768,7 +3771,10 @@ namespace winrt::TerminalApp::implementation
3768
3771
}
3769
3772
}
3770
3773
3771
- winrt::Microsoft::Terminal::Settings::Editor::MainPage sui{ _settings };
3774
+ // Create the SUI pane content
3775
+ auto settingsContent{ winrt::make_self<SettingsPaneContent>(_settings) };
3776
+ auto sui = settingsContent->SettingsUI ();
3777
+
3772
3778
if (_hostingHwnd)
3773
3779
{
3774
3780
sui.SetHostingWindow (reinterpret_cast <uint64_t >(*_hostingHwnd));
@@ -3784,52 +3790,58 @@ namespace winrt::TerminalApp::implementation
3784
3790
}
3785
3791
});
3786
3792
3787
- auto newTabImpl = winrt::make_self<SettingsTab>(sui, _settings.GlobalSettings ().CurrentTheme ().RequestedTheme ());
3793
+ // Create the tab
3794
+ auto resultPane = std::make_shared<Pane>(*settingsContent);
3795
+ _settingsTab = _CreateNewTabFromPane (resultPane);
3788
3796
3789
- // Add the new tab to the list of our tabs.
3790
- _tabs.Append (*newTabImpl);
3791
- _mruTabs.Append (*newTabImpl);
3797
+ // auto newTabImpl = winrt::make_self<SettingsTab>(sui, _settings.GlobalSettings().CurrentTheme().RequestedTheme());
3792
3798
3793
- newTabImpl->SetDispatch (*_actionDispatch);
3794
- newTabImpl->SetActionMap (_settings.ActionMap ());
3799
+ // // Add the new tab to the list of our tabs.
3800
+ // _tabs.Append(*newTabImpl);
3801
+ // _mruTabs.Append(*newTabImpl);
3795
3802
3796
- // Give the tab its index in the _tabs vector so it can manage its own SwitchToTab command.
3797
- _UpdateTabIndices ( );
3803
+ // newTabImpl->SetDispatch(*_actionDispatch);
3804
+ // newTabImpl->SetActionMap(_settings.ActionMap() );
3798
3805
3799
- // Don't capture a strong ref to the tab. If the tab is removed as this
3800
- // is called, we don't really care anymore about handling the event.
3801
- auto weakTab = make_weak (newTabImpl);
3806
+ // // Give the tab its index in the _tabs vector so it can manage its own SwitchToTab command.
3807
+ // _UpdateTabIndices();
3802
3808
3803
- auto tabViewItem = newTabImpl->TabViewItem ();
3804
- _tabView.TabItems ().Append (tabViewItem);
3809
+ // // Don't capture a strong ref to the tab. If the tab is removed as this
3810
+ // // is called, we don't really care anymore about handling the event.
3811
+ // auto weakTab = make_weak(newTabImpl);
3805
3812
3806
- tabViewItem.PointerPressed ({ this , &TerminalPage::_OnTabClick });
3813
+ // auto tabViewItem = newTabImpl->TabViewItem();
3814
+ // _tabView.TabItems().Append(tabViewItem);
3807
3815
3808
- // When the tab requests close, try to close it (prompt for approval, if required)
3809
- newTabImpl->CloseRequested ([weakTab, weakThis{ get_weak () }](auto && /* s*/ , auto && /* e*/ ) {
3810
- auto page{ weakThis.get () };
3811
- auto tab{ weakTab.get () };
3816
+ // tabViewItem.PointerPressed({ this, &TerminalPage::_OnTabClick });
3812
3817
3813
- if (page && tab)
3814
- {
3815
- page->_HandleCloseTabRequested (*tab);
3816
- }
3817
- });
3818
+ // // When the tab requests close, try to close it (prompt for approval, if required)
3819
+ // newTabImpl->CloseRequested([weakTab, weakThis{ get_weak() }](auto&& /*s*/, auto&& /*e*/) {
3820
+ // auto page{ weakThis.get() };
3821
+ // auto tab{ weakTab.get() };
3818
3822
3819
- // When the tab is closed, remove it from our list of tabs.
3820
- newTabImpl->Closed ([tabViewItem, weakThis{ get_weak () }](auto && /* s*/ , auto && /* e*/ ) {
3821
- if (auto page{ weakThis.get () })
3822
- {
3823
- page->_settingsTab = nullptr ;
3824
- page->_RemoveOnCloseRoutine (tabViewItem, page);
3825
- }
3826
- });
3823
+ // if (page && tab)
3824
+ // {
3825
+ // page->_HandleCloseTabRequested(*tab);
3826
+ // }
3827
+ // });
3828
+
3829
+ // TODO! Make sure we remove the _settingsTab if it is closed!
3830
+
3831
+ // // When the tab is closed, remove it from our list of tabs.
3832
+ // newTabImpl->Closed([tabViewItem, weakThis{ get_weak() }](auto&& /*s*/, auto&& /*e*/) {
3833
+ // if (auto page{ weakThis.get() })
3834
+ // {
3835
+ // page->_settingsTab = nullptr;
3836
+ // page->_RemoveOnCloseRoutine(tabViewItem, page);
3837
+ // }
3838
+ // });
3827
3839
3828
- _settingsTab = *newTabImpl;
3840
+ // _settingsTab = *newTabImpl;
3829
3841
3830
- // This kicks off TabView::SelectionChanged, in response to which
3831
- // we'll attach the terminal's Xaml control to the Xaml root.
3832
- _tabView.SelectedItem (tabViewItem);
3842
+ // // This kicks off TabView::SelectionChanged, in response to which
3843
+ // // we'll attach the terminal's Xaml control to the Xaml root.
3844
+ // _tabView.SelectedItem(tabViewItem);
3833
3845
}
3834
3846
else
3835
3847
{
0 commit comments