Bläddra i källkod

Fixed file dialog icons and text

Ivan Safrin 12 år sedan
förälder
incheckning
97eedd801c

+ 2 - 2
Modules/Contents/UI/Include/PolyUIFileDialog.h

@@ -52,9 +52,9 @@ namespace Polycode {
 
 
 			bool canSelect;
 			bool canSelect;
 			UIRect *bg;
 			UIRect *bg;
-			SceneLabel *label;
+			UILabel *label;
 			OSFileEntry fileEntry;
 			OSFileEntry fileEntry;
-			SceneImage *icon;
+			UIImage *icon;
 	};
 	};
 
 
 	/**
 	/**

+ 10 - 7
Modules/Contents/UI/Source/PolyUIFileDialog.cpp

@@ -1,6 +1,7 @@
 
 
 #include "PolyUIFileDialog.h"
 #include "PolyUIFileDialog.h"
 #include "PolyConfig.h"
 #include "PolyConfig.h"
+#include "PolyRenderer.h"
 
 
 using namespace Polycode;
 using namespace Polycode;
 
 
@@ -16,25 +17,27 @@ UIFileDialogEntry::UIFileDialogEntry(OSFileEntry entry, bool canSelect, int widt
 	bg = new UIRect(width, 18);
 	bg = new UIRect(width, 18);
 	bg->setAnchorPoint(-1.0, -1.0, 0.0);
 	bg->setAnchorPoint(-1.0, -1.0, 0.0);
 	addChild(bg);
 	addChild(bg);
-	bg->setColor(0.0, 0.0, 0.0, 0.1);
+	bg->setColor(0.5, 0.5, 0.5, 1.0);
 	bg->processInputEvents = true;
 	bg->processInputEvents = true;
+	bg->visible = false;
 
 
 	this->fileEntry = entry;
 	this->fileEntry = entry;
 
 
 	if(isPlace) {
 	if(isPlace) {
-		icon = new SceneImage(placeIconName);
+		icon = new UIImage(placeIconName);
 	} else {
 	} else {
 		if(entry.type == OSFileEntry::TYPE_FILE) {
 		if(entry.type == OSFileEntry::TYPE_FILE) {
-			icon = new SceneImage(fileIconName);
+			icon = new UIImage(fileIconName);
 		} else {
 		} else {
-			icon = new SceneImage(folderIconName);
+			icon = new UIImage(folderIconName);
 		}
 		}
 	}
 	}
 
 
+	icon->setBlendingMode(Renderer::BLEND_MODE_NORMAL);
 	addChild(icon);
 	addChild(icon);
 	icon->setPosition(3,1);
 	icon->setPosition(3,1);
 
 
-	label = new SceneLabel(entry.name, 12, "sans");
+	label = new UILabel(entry.name, 12, "sans");
 	addChild(label);
 	addChild(label);
 	label->setPosition(25, 2);
 	label->setPosition(25, 2);
 
 
@@ -45,11 +48,11 @@ UIFileDialogEntry::UIFileDialogEntry(OSFileEntry entry, bool canSelect, int widt
 }
 }
 
 
 void UIFileDialogEntry::Select() {
 void UIFileDialogEntry::Select() {
-	bg->setColor(0.0, 0.0, 0.0, 0.5);
+	bg->visible = true;
 }
 }
 
 
 void UIFileDialogEntry::Deselect() {
 void UIFileDialogEntry::Deselect() {
-	bg->setColor(0.0, 0.0, 0.0, 0.1);
+	bg->visible = false;
 }
 }
 
 
 UIFileDialogEntry::~UIFileDialogEntry() {
 UIFileDialogEntry::~UIFileDialogEntry() {