File tree Expand file tree Collapse file tree 5 files changed +28
-22
lines changed Expand file tree Collapse file tree 5 files changed +28
-22
lines changed Original file line number Diff line number Diff line change @@ -136,26 +136,7 @@ namespace winrt::TerminalApp::implementation
136
136
// When the tab's active pane changes, we'll want to lookup a new icon
137
137
// for it. The Title change will be propagated upwards through the tab's
138
138
// PropertyChanged event handler.
139
- newTabImpl->ActivePaneChanged ([weakTab, weakThis{ get_weak () }]() {
140
- auto page{ weakThis.get () };
141
- auto tab{ weakTab.get () };
142
-
143
- if (page && tab)
144
- {
145
- // Possibly update the icon of the tab.
146
- page->_UpdateTabIcon (*tab);
147
-
148
- page->_updateThemeColors ();
149
-
150
- // Update the taskbar progress as well. We'll raise our own
151
- // SetTaskbarProgress event here, to get tell the hosting
152
- // application to re-query this value from us.
153
- page->SetTaskbarProgress .raise (*page, nullptr );
154
-
155
- auto profile = tab->GetFocusedProfile ();
156
- page->_UpdateBackground (profile);
157
- }
158
- });
139
+ newTabImpl->ActivePaneChanged ({ get_weak (), &TerminalPage::_activePaneChanged });
159
140
160
141
// The RaiseVisualBell event has been bubbled up to here from the pane,
161
142
// the next part of the chain is bubbling up to app logic, which will
Original file line number Diff line number Diff line change @@ -2237,6 +2237,29 @@ namespace winrt::TerminalApp::implementation
2237
2237
return true ;
2238
2238
}
2239
2239
2240
+ // When the tab's active pane changes, we'll want to lookup a new icon
2241
+ // for it. The Title change will be propagated upwards through the tab's
2242
+ // PropertyChanged event handler.
2243
+ void TerminalPage::_activePaneChanged (winrt::TerminalApp::TerminalTab sender,
2244
+ Windows::Foundation::IInspectable args)
2245
+ {
2246
+ if (const auto tab{ _GetTerminalTabImpl (sender) })
2247
+ {
2248
+ // Possibly update the icon of the tab.
2249
+ _UpdateTabIcon (*tab);
2250
+
2251
+ _updateThemeColors ();
2252
+
2253
+ // Update the taskbar progress as well. We'll raise our own
2254
+ // SetTaskbarProgress event here, to get tell the hosting
2255
+ // application to re-query this value from us.
2256
+ SetTaskbarProgress.raise (*this , nullptr );
2257
+
2258
+ auto profile = tab->GetFocusedProfile ();
2259
+ _UpdateBackground (profile);
2260
+ }
2261
+ }
2262
+
2240
2263
uint32_t TerminalPage::NumberOfTabs () const
2241
2264
{
2242
2265
return _tabs.Size ();
Original file line number Diff line number Diff line change @@ -542,6 +542,8 @@ namespace winrt::TerminalApp::implementation
542
542
winrt::Microsoft::Terminal::Control::TermControl _senderOrActiveControl (const winrt::Windows::Foundation::IInspectable& sender);
543
543
winrt::com_ptr<TerminalTab> _senderOrFocusedTab (const IInspectable& sender);
544
544
545
+ void _activePaneChanged (winrt::TerminalApp::TerminalTab tab, Windows::Foundation::IInspectable args);
546
+
545
547
#pragma region ActionHandlers
546
548
// These are all defined in AppActionHandlers.cpp
547
549
#define ON_ALL_ACTIONS (action ) DECLARE_ACTION_HANDLER(action);
Original file line number Diff line number Diff line change @@ -1242,7 +1242,7 @@ namespace winrt::TerminalApp::implementation
1242
1242
_RecalculateAndApplyReadOnly ();
1243
1243
1244
1244
// Raise our own ActivePaneChanged event.
1245
- ActivePaneChanged.raise ();
1245
+ ActivePaneChanged.raise (* this , nullptr );
1246
1246
}
1247
1247
1248
1248
// Method Description:
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ namespace winrt::TerminalApp::implementation
99
99
100
100
til::typed_event<TerminalApp::TerminalPaneContent> RestartTerminalRequested;
101
101
102
- til::event<winrt::delegate<> > ActivePaneChanged;
102
+ til::typed_event<TerminalApp::TerminalTab, IInspectable > ActivePaneChanged;
103
103
til::event<winrt::delegate<>> TabRaiseVisualBell;
104
104
til::typed_event<IInspectable, IInspectable> TaskbarProgressChanged;
105
105
You can’t perform that action at this time.
0 commit comments