Skip to content

Commit

Permalink
#5752: Refactoring/formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Sep 17, 2021
1 parent 3cb6b0d commit d23d882
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions radiant/ui/common/ShaderChooser.cpp
Expand Up @@ -32,20 +32,22 @@ ShaderChooser::ShaderChooser(wxWindow* parent, wxTextCtrl* targetEntry) :

_selector = new ShaderSelector(mainPanel, this, SHADER_PREFIXES);

if (_targetEntry != NULL)
if (_targetEntry != nullptr)
{
_initialShader = targetEntry->GetValue();
_initialShader = _targetEntry->GetValue();

// Set the cursor of the tree view to the currently selected shader
_selector->setSelection(_initialShader);
Bind( wxEVT_DATAVIEW_ITEM_ACTIVATED, [&]( wxCommandEvent& ev )

Bind(wxEVT_DATAVIEW_ITEM_ACTIVATED, [&](wxCommandEvent& ev)
{
if (!_selector->getSelection().empty())
{
if ( !this->_selector->getSelection().empty() ) {
_targetEntry->SetValue( _selector->getSelection() );
shutdown();
EndModal( wxID_OK );
}
} );
_targetEntry->SetValue(_selector->getSelection());
shutdown();
EndModal(wxID_OK);
}
});
}

// Pack in the ShaderSelector and buttons panel
Expand Down

0 comments on commit d23d882

Please sign in to comment.