@@ -93,71 +93,4 @@ TSharedRef< SWidget > FPythonConsoleModule::MakeConsoleInputBox( TSharedPtr< SEd
9393 TSharedRef< SPythonConsoleInputBox > NewConsoleInputBox = SNew ( SPythonConsoleInputBox );
9494 OutExposedEditableTextBox = NewConsoleInputBox->GetEditableTextBox ();
9595 return NewConsoleInputBox;
96- }
97-
98-
99- void FPythonConsoleModule::TogglePythonConsoleForWindow ( const TSharedRef< SWindow >& Window, const EPythonConsoleStyle::Type InStyle, const FPythonConsoleDelegates& PythonConsoleDelegates )
100- {
101- bool bShouldOpen = true ;
102- // Close an existing console box, if there is one
103- TSharedPtr< SWidget > PinnedPythonConsole ( PythonConsole.Pin () );
104- if ( PinnedPythonConsole.IsValid () )
105- {
106- // If the console is already open close it unless it is in a different window. In that case reopen it on that window
107- bShouldOpen = false ;
108- TSharedPtr< SWindow > WindowForExistingConsole = FSlateApplication::Get ().FindWidgetWindow (PinnedPythonConsole.ToSharedRef ());
109- if (WindowForExistingConsole.IsValid ())
110- {
111- WindowForExistingConsole->RemoveOverlaySlot (PinnedPythonConsole.ToSharedRef ());
112- PythonConsole.Reset ();
113- }
114-
115- if ( WindowForExistingConsole != Window )
116- {
117- // Console is being opened on another window
118- bShouldOpen = true ;
119- }
120- }
121-
122- TSharedPtr<SDockTab> ActiveTab = FGlobalTabmanager::Get ()->GetActiveTab ();
123- if (ActiveTab.IsValid () && ActiveTab->GetLayoutIdentifier () == FTabId (PythonConsoleModule::PythonLogTabName))
124- {
125- FGlobalTabmanager::Get ()->DrawAttention (ActiveTab.ToSharedRef ());
126- bShouldOpen = false ;
127- }
128-
129- if ( bShouldOpen )
130- {
131- const EPythonConsoleStyle::Type PythonConsoleStyle = InStyle;
132- TSharedRef< SPythonConsole > PythonConsoleRef = SNew ( SPythonConsole, PythonConsoleStyle, this , &PythonConsoleDelegates );
133- PythonConsole = PythonConsoleRef;
134-
135- const int32 MaximumZOrder = MAX_int32;
136- Window->AddOverlaySlot ( MaximumZOrder )
137- .VAlign (VAlign_Bottom)
138- .HAlign (HAlign_Center)
139- .Padding ( 10 .0f )
140- [
141- PythonConsoleRef
142- ];
143-
144- // Force keyboard focus
145- PythonConsoleRef->SetFocusToEditableText ();
146- }
147- }
148-
149-
150- void FPythonConsoleModule::ClosePythonConsole ()
151- {
152- TSharedPtr< SWidget > PinnedPythonConsole ( PythonConsole.Pin () );
153-
154- if ( PinnedPythonConsole.IsValid () )
155- {
156- TSharedPtr< SWindow > WindowForExistingConsole = FSlateApplication::Get ().FindWidgetWindow (PinnedPythonConsole.ToSharedRef ());
157- if (WindowForExistingConsole.IsValid ())
158- {
159- WindowForExistingConsole->RemoveOverlaySlot ( PinnedPythonConsole.ToSharedRef () );
160- PythonConsole.Reset ();
161- }
162- }
16396}
0 commit comments