Skip to content

Commit

Permalink
#6021: Refactoring in SoundChooser
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Jul 29, 2022
1 parent 5811d7e commit 4c99a47
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions radiant/ui/common/SoundChooser.cpp
Expand Up @@ -215,16 +215,15 @@ const std::string& SoundChooser::getSelectedShader() const
return _selectedShader;
}

// Set the selected sound shader, and focuses the treeview to the new selection
void SoundChooser::setSelectedShader(const std::string& shader)
{
_treeView->SetSelectedElement(shader, _columns.leafName);
_treeView->SetSelectedDeclName(shader);
}

void SoundChooser::handleSelectionChange()
{
_selectedShader = !_treeView->IsDirectorySelected() ?
_treeView->GetSelectedElement(_columns.leafName) : std::string();
_treeView->GetSelectedDeclName() : std::string();

// Notify the preview widget about the change
_preview->setSoundShader(_selectedShader);
Expand Down

0 comments on commit 4c99a47

Please sign in to comment.