Skip to content

Commit 4824429

Browse files
committed
Proper file icons in the new file dialog
1 parent 9ac288b commit 4824429

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

IDE/Contents/Include/NewFileWindow.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "PolycodeUI.h"
2727
#include "Polycode.h"
2828
#include "OSBasics.h"
29+
#include "PolycodeProjectBrowser.h"
2930

3031
using namespace Polycode;
3132

IDE/Contents/Include/PolycodeProjectBrowser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class PolycodeProjectBrowser : public UIElement {
6262
UITree *nodeHasName(UITree *node, String name);
6363
bool listHasFileEntry(vector<OSFileEntry> files, OSFileEntry fileEntry);
6464

65-
String getIconForExtension(String extension);
65+
static String getIconForExtension(String extension);
6666

6767
void Refresh();
6868

IDE/Contents/Source/NewFileWindow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ void NewFileWindow::parseTemplatesIntoTree(UITree *tree, OSFileEntry folder) {
133133
for(int i=0; i < templates.size(); i++) {
134134
OSFileEntry entry = templates[i];
135135
if(entry.type != OSFileEntry::TYPE_FOLDER) {
136-
UITree *newChild = tree->addTreeChild("file.png", entry.nameWithoutExtension, NULL);
136+
UITree *newChild = tree->addTreeChild(PolycodeProjectBrowser::getIconForExtension(entry.extension), entry.nameWithoutExtension, NULL);
137137
FileTemplateUserData *data = new FileTemplateUserData();
138138
data->type = 1;
139139
data->templatePath = entry.fullPath;

0 commit comments

Comments
 (0)