Skip to content

Commit

Permalink
Resolve #4785: Double-clicking an element in the MediaBrowser tree wi…
Browse files Browse the repository at this point in the history
…ll apply the material to the selection.
  • Loading branch information
codereader committed May 1, 2018
1 parent 5308213 commit 0d4ea12
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions radiant/ui/mediabrowser/MediaBrowser.cpp
Expand Up @@ -375,6 +375,17 @@ void MediaBrowser::construct()
_treeView->Connect(wxEVT_DATAVIEW_ITEM_CONTEXT_MENU,
wxDataViewEventHandler(MediaBrowser::_onContextMenu), nullptr, this);

_treeView->Bind(wxEVT_DATAVIEW_ITEM_ACTIVATED, [this](wxDataViewEvent& ev)
{
std::string selection = getSelection();

if (!isDirectorySelected() && !selection.empty())
{
// Pass shader name to the selection system
selection::algorithm::applyShaderToSelection(selection);
}
});

// Add the info pane
_preview = new TexturePreviewCombo(_mainWidget);
_mainWidget->GetSizer()->Add(_preview, 0, wxEXPAND);
Expand Down

0 comments on commit 0d4ea12

Please sign in to comment.