Просмотр исходного кода

Proper file icons in the new file dialog

Ivan Safrin 11 лет назад
Родитель
Сommit
482442969b

+ 1 - 0
IDE/Contents/Include/NewFileWindow.h

@@ -26,6 +26,7 @@
 #include "PolycodeUI.h"
 #include "Polycode.h"
 #include "OSBasics.h"
+#include "PolycodeProjectBrowser.h"
 
 using namespace Polycode;
 

+ 1 - 1
IDE/Contents/Include/PolycodeProjectBrowser.h

@@ -62,7 +62,7 @@ class PolycodeProjectBrowser : public UIElement {
 		UITree *nodeHasName(UITree *node, String name);
 		bool listHasFileEntry(vector<OSFileEntry> files, OSFileEntry fileEntry);
 		
-        String getIconForExtension(String extension);
+        static String getIconForExtension(String extension);
     
 		void Refresh();
 		

+ 1 - 1
IDE/Contents/Source/NewFileWindow.cpp

@@ -133,7 +133,7 @@ void NewFileWindow::parseTemplatesIntoTree(UITree *tree, OSFileEntry folder) {
 	for(int i=0; i < templates.size(); i++) {
 		OSFileEntry entry = templates[i];	
 		if(entry.type != OSFileEntry::TYPE_FOLDER) {
-			UITree *newChild = tree->addTreeChild("file.png", entry.nameWithoutExtension, NULL);
+            UITree *newChild = tree->addTreeChild(PolycodeProjectBrowser::getIconForExtension(entry.extension), entry.nameWithoutExtension, NULL);
 			FileTemplateUserData *data = new FileTemplateUserData();
 			data->type = 1;
 			data->templatePath = entry.fullPath;