diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-08-05 15:34:31 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-08-05 15:34:31 (GMT) |
| commit | 9e309135d403f0f99f586015ffd194a8914ae504 (patch) | |
| tree | 90594d61625a85f931925f3efc279b19d3dbc30f /src/elementsearch/ElementSearchActivity.cpp | |
| parent | 6e324c82e2a81d22b4ee09637be64d9b4c24bf1d (diff) | |
| download | powder-9e309135d403f0f99f586015ffd194a8914ae504.zip powder-9e309135d403f0f99f586015ffd194a8914ae504.tar.gz | |
Load element icons in element search, fixes #73
Diffstat (limited to 'src/elementsearch/ElementSearchActivity.cpp')
| -rw-r--r-- | src/elementsearch/ElementSearchActivity.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/elementsearch/ElementSearchActivity.cpp b/src/elementsearch/ElementSearchActivity.cpp index 1ee41e1..c8b0b82 100644 --- a/src/elementsearch/ElementSearchActivity.cpp +++ b/src/elementsearch/ElementSearchActivity.cpp @@ -115,7 +115,15 @@ void ElementSearchActivity::searchTools(std::string query) if(!firstResult) firstResult = tool; - ToolButton * tempButton = new ToolButton(current+viewPosition, ui::Point(30, 18), tool->GetName()); + VideoBuffer * tempTexture = tool->GetTexture(26, 14); + ToolButton * tempButton; + + if(tempTexture) + tempButton = new ToolButton(current+viewPosition, ui::Point(30, 18), "", tool->GetDescription()); + else + tempButton = new ToolButton(current+viewPosition, ui::Point(30, 18), tool->GetName(), tool->GetDescription()); + + tempButton->Appearance.SetTexture(tempTexture); tempButton->Appearance.BackgroundInactive = ui::Colour(tool->colRed, tool->colGreen, tool->colBlue); tempButton->SetActionCallback(new ToolAction(this, tool)); |
