Преглед изворни кода

Fixed colors (some hardcoded colors for now)

Ivan Safrin пре 9 година
родитељ
комит
2c82c21faf

+ 1 - 0
include/polycode/modules/ui/PolyUIElement.h

@@ -120,6 +120,7 @@ namespace Polycode {
 		public:
 			UILabel(const String& text, int size=-1, const String& fontName = "sans", int amode = 0);
 			void setText(const String& text);
+            void setLabelColor(const Color &color);
 			Label *getLabel();
 			String getText();
 			

+ 1 - 1
src/modules/ui/PolyUIComboBox.cpp

@@ -82,7 +82,7 @@ UIComboBox::UIComboBox(UIGlobalMenu *globalMenu, Number comboWidth) : UIElement(
 	selectedLabel->setPosition(paddingX, paddingY);
 	addChild(selectedLabel);
 	
-	selectedLabel->color.setColorHexFromString(conf->getStringValue("Polycode", "uiDefaultFontColor"));
+    selectedLabel->setLabelColor(Color(0.0, 0.0, 0.0, 1.0));
 	
 	String selectorBgImage = conf->getStringValue("Polycode", "uiComboBoxSelectorBgImage");	
 	

+ 4 - 0
src/modules/ui/PolyUIElement.cpp

@@ -149,6 +149,10 @@ UILabel::UILabel(const String& text, int size, const String& fontName, int amode
 	setLocalBoundingBox(label->getLocalBoundingBox());
 }
 
+void UILabel::setLabelColor(const Color &color) {
+    label->color = color;
+}
+
 void UILabel::setText(const String& text) {
 	label->setText(text);
     setLocalBoundingBox(label->getLocalBoundingBox());

+ 1 - 1
src/modules/ui/PolyUIMenu.cpp

@@ -47,7 +47,7 @@ UIMenuItem::UIMenuItem(String label, String _id, void *data, Number comboWidth,
     itemLabel->setBlendingMode(Renderer::BLEND_MODE_NORMAL);
 	itemLabel->setPosition(paddingX, floor(((comboHeight/2.0) - itemLabel->getHeight()/2.0) + paddingY));
 	addChild(itemLabel);
-	itemLabel->color.setColorHexFromString(conf->getStringValue("Polycode", "uiDefaultFontColor"));
+    itemLabel->color.setColor(0.0, 0.0, 0.0, 1.0);
 	this->_id = _id;
 	this->data = data;
 }