3
3
4
4
#include " pch.h"
5
5
#include " TerminalPaneContent.h"
6
+ #include " PaneArgs.h"
6
7
#include " TerminalPaneContent.g.cpp"
7
8
8
9
#include < Mmsystem.h>
@@ -25,9 +26,15 @@ namespace winrt::TerminalApp::implementation
25
26
void TerminalPaneContent::_setupControlEvents ()
26
27
{
27
28
_controlEvents._ConnectionStateChanged = _control.ConnectionStateChanged (winrt::auto_revoke, { this , &TerminalPaneContent::_ControlConnectionStateChangedHandler });
28
- _controlEvents._WarningBell = _control.WarningBell (winrt::auto_revoke, { this , &TerminalPaneContent::_ControlWarningBellHandler });
29
- _controlEvents._CloseTerminalRequested = _control.CloseTerminalRequested (winrt::auto_revoke, { this , &TerminalPaneContent::_CloseTerminalRequestedHandler });
30
- _controlEvents._RestartTerminalRequested = _control.RestartTerminalRequested (winrt::auto_revoke, { this , &TerminalPaneContent::_RestartTerminalRequestedHandler });
29
+ _controlEvents._WarningBell = _control.WarningBell (winrt::auto_revoke, { get_weak (), &TerminalPaneContent::_ControlWarningBellHandler });
30
+ _controlEvents._CloseTerminalRequested = _control.CloseTerminalRequested (winrt::auto_revoke, { get_weak (), &TerminalPaneContent::_CloseTerminalRequestedHandler });
31
+ _controlEvents._RestartTerminalRequested = _control.RestartTerminalRequested (winrt::auto_revoke, { get_weak (), &TerminalPaneContent::_RestartTerminalRequestedHandler });
32
+
33
+ _controlEvents._TitleChanged = _control.TitleChanged (winrt::auto_revoke, { get_weak (), &TerminalPaneContent::_controlTitleChanged });
34
+ _controlEvents._TabColorChanged = _control.TabColorChanged (winrt::auto_revoke, { get_weak (), &TerminalPaneContent::_controlTabColorChanged });
35
+ _controlEvents._SetTaskbarProgress = _control.SetTaskbarProgress (winrt::auto_revoke, { get_weak (), &TerminalPaneContent::_controlSetTaskbarProgress });
36
+ _controlEvents._ReadOnlyChanged = _control.ReadOnlyChanged (winrt::auto_revoke, { get_weak (), &TerminalPaneContent::_controlReadOnlyChanged });
37
+ _controlEvents._FocusFollowMouseRequested = _control.FocusFollowMouseRequested (winrt::auto_revoke, { get_weak (), &TerminalPaneContent::_controlFocusFollowMouseRequested });
31
38
}
32
39
void TerminalPaneContent::_removeControlEvents ()
33
40
{
@@ -46,9 +53,9 @@ namespace winrt::TerminalApp::implementation
46
53
{
47
54
return _control.MinimumSize ();
48
55
}
49
- void TerminalPaneContent::Focus ()
56
+ void TerminalPaneContent::Focus (winrt::Windows::UI::Xaml::FocusState reason )
50
57
{
51
- _control.Focus (FocusState::Programmatic );
58
+ _control.Focus (reason );
52
59
}
53
60
void TerminalPaneContent::Close ()
54
61
{
@@ -122,6 +129,27 @@ namespace winrt::TerminalApp::implementation
122
129
return args;
123
130
}
124
131
132
+ void TerminalPaneContent::_controlTitleChanged (const IInspectable&, const IInspectable&)
133
+ {
134
+ TitleChanged.raise (*this , nullptr );
135
+ }
136
+ void TerminalPaneContent::_controlTabColorChanged (const IInspectable&, const IInspectable&)
137
+ {
138
+ TabColorChanged.raise (*this , nullptr );
139
+ }
140
+ void TerminalPaneContent::_controlSetTaskbarProgress (const IInspectable&, const IInspectable&)
141
+ {
142
+ TaskbarProgressChanged.raise (*this , nullptr );
143
+ }
144
+ void TerminalPaneContent::_controlReadOnlyChanged (const IInspectable&, const IInspectable&)
145
+ {
146
+ ReadOnlyChanged.raise (*this , nullptr );
147
+ }
148
+ void TerminalPaneContent::_controlFocusFollowMouseRequested (const IInspectable&, const IInspectable&)
149
+ {
150
+ FocusRequested.raise (*this , nullptr );
151
+ }
152
+
125
153
// Method Description:
126
154
// - Called when our attached control is closed. Triggers listeners to our close
127
155
// event, if we're a leaf pane.
@@ -209,9 +237,9 @@ namespace winrt::TerminalApp::implementation
209
237
_control.BellLightOn ();
210
238
}
211
239
212
- // TODO!
213
- // // raise the event with the bool value corresponding to the taskbar flag
214
- // _PaneRaiseBellHandlers(nullptr, WI_IsFlagSet(_profile.BellStyle(), winrt::Microsoft::Terminal::Settings::Model:: BellStyle::Taskbar));
240
+ // raise the event with the bool value corresponding to the taskbar flag
241
+ BellRequested. raise (* this ,
242
+ *winrt::make_self<TerminalApp::implementation::BellEventArgs>( WI_IsFlagSet (_profile.BellStyle (), BellStyle::Taskbar) ));
215
243
}
216
244
}
217
245
}
0 commit comments