Skip to content
Snippets Groups Projects
Commit d4ace4b3 authored by jsiegle's avatar jsiegle
Browse files

Updated color scheme.

parent 8129d839
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,8 @@
<PROCESSORGRAPH>
<SIGNALCHAIN>
<PROCESSOR name="Sources/Signal Generator" insertionPoint="0"/>
<PROCESSOR name="Sinks/LFP Viewer" insertionPoint="1"/>
<PROCESSOR name="Sources/Intan Demo Board" insertionPoint="0"/>
<PROCESSOR name="Filters/Bandpass Filter" insertionPoint="1"/>
<PROCESSOR name="Sinks/LFP Viewer" insertionPoint="2"/>
</SIGNALCHAIN>
</PROCESSORGRAPH>
<?xml version="1.0" encoding="UTF-8"?>
<MAINWINDOW>
<BOUNDS x="1736" y="52" w="1293" h="968" fullscreen="0"/>
<BOUNDS x="1765" y="106" w="988" h="744" fullscreen="0"/>
</MAINWINDOW>
......@@ -27,13 +27,13 @@ GenericEditor::GenericEditor (GenericProcessor* owner, FilterViewport* vp)
//titleFont->setTypefaceName(T("Miso"));
if (owner->isSource())
backgroundColor = Colour(int(0.9*255.0f),int(0.019*255.0f),int(0.16*255.0f));
backgroundColor = Colour(255, 0, 0);//Colour(int(0.9*255.0f),int(0.019*255.0f),int(0.16*255.0f));
else if (owner->isSink())
backgroundColor = Colour(int(0.06*255.0f),int(0.46*255.0f),int(0.9*255.0f));
backgroundColor = Colour(255, 149, 0);//Colour(int(0.06*255.0f),int(0.46*255.0f),int(0.9*255.0f));
else if (owner->isSplitter() || owner->isMerger())
backgroundColor = Colour(int(0.7*255.0f),int(0.7*255.0f),int(0.7*255.0f));
backgroundColor = Colour(80, 80, 80);//Colour(int(0.7*255.0f),int(0.7*255.0f),int(0.7*255.0f));
else
backgroundColor = Colour(int(1.0*255.0f),int(0.5*255.0f),int(0.0*255.0f));
backgroundColor = Colour(255, 89, 0);//Colour(int(1.0*255.0f),int(0.5*255.0f),int(0.0*255.0f));
}
......@@ -132,39 +132,21 @@ void GenericEditor::paint (Graphics& g)
GenericProcessor* p = (GenericProcessor*) getProcessor();
//g.setColour(Colour(127,137,147));
//g.fillAll();
if (isSelected)
if (isSelected) {
g.setColour(Colours::yellow);
else
g.setColour(Colours::darkgrey);
g.fillRoundedRectangle(0,0,getWidth()-offset,getHeight(),7.0);
g.fillRect(0,0,getWidth()-offset,getHeight());
}
if (isEnabled)
g.setColour(backgroundColor);
else
g.setColour(Colours::lightgrey);
// if (p->isSource()) {
// g.setColour(Colours::red);
// } else if (p->isSink()) {
// g.setColour(Colours::blue);
// } else if (p->isSplitter() || p->isMerger())
// {
// g.setColour(Colours::darkgrey);
// } else {
// g.setColour(Colours::red);
// }
g.fillRoundedRectangle(1,1,getWidth()-(2+offset),getHeight()-2,6.0);
g.setColour(Colours::grey);
g.fillRoundedRectangle(4,15,getWidth()-(8+offset), getHeight()-19,5.0);
g.fillRect(4,15,getWidth()-(8+offset), 20);
g.fillRect(1,1,getWidth()-(2+offset),getHeight()-2);
g.setColour(Colour(192, 205, 209));
g.fillRect(4,20,getWidth()-(8+offset), getHeight()-24);
//g.fillRect(4,15,getWidth()-(8+offset), 20);
Font titleFont = Font(14.0, Font::plain);
......
......@@ -53,6 +53,26 @@ FilterList::FilterList() : isDragging(false)
baseItem->addSubItem(sinks);
baseItem->addSubItem(utilities);
// set parent names / colors
baseItem->setParentName("Processors");
for (int n = 0; n < baseItem->getNumSubItems(); n++)
{
const String category = baseItem->getSubItem(n)->getName();
baseItem->getSubItem(n)->setParentName(category);
for (int m = 0; m < baseItem->getSubItem(n)->getNumSubItems(); m++)
{
baseItem->getSubItem(n)->getSubItem(m)->setParentName(category);// = category;
}
}
}
FilterList::~FilterList()
......@@ -133,8 +153,6 @@ void FilterList::drawItems()
hasSubItems());
drawItem(baseItem->getSubItem(n)->getSubItem(m));
baseItem->getSubItem(n)->getSubItem(m)->parentName = category;
}
}
}
......@@ -146,30 +164,11 @@ void FilterList::drawItems()
void FilterList::drawItem(FilterListItem* item)
{
if (category.startsWith("P"))
{
glColor4f(0.23f, 0.23f, 0.23f, 1.0f); // [59 59 59]
item->color = Colour(int(0.23*255.0f),int(0.23*255.0f),int(0.23*255.0f));
} else if (category.startsWith("So"))
{
glColor4f(0.9f, 0.019f, 0.16f, 1.0f); // [232 5 43]
item->color = Colour(int(0.9*255.0f),int(0.019*255.0f),int(0.16*255.0f));
} else if (category.startsWith("F"))
{
glColor4f(1.0f, 0.5f, 0.0f, 1.0f);
item->color = Colour(int(1.0*255.0f),int(0.5*255.0f),int(0.0*255.0f));
} else if (category.startsWith("Si"))
{
glColor4f(0.06f, 0.46f, 0.9f, 1.0f);
item->color = Colour(int(0.06*255.0f),int(0.46*255.0f),int(0.9*255.0f));
} else if (category.startsWith("U"))
{
glColor4f(0.7f, 0.7f, 0.7f, 1.0f);
item->color = Colour(int(0.7*255.0f),int(0.7*255.0f),int(0.7*255.0f));
} else {
glColor4f(0.7f, 0.7f, 0.7f, 1.0f);
item->color = Colour(int(0.7*255.0f),int(0.7*255.0f),int(0.7*255.0f));
}
glColor4f(item->color.getFloatRed(),
item->color.getFloatGreen(),
item->color.getFloatBlue(),
1.0f);
glBegin(GL_POLYGON);
glVertex2f(0,0);
......@@ -178,20 +177,6 @@ void FilterList::drawItem(FilterListItem* item)
glVertex2f(0,1);
glEnd();
// if (item->isSelected())
// {
// glColor4f(1.0,1.0,1.0,1.0);
// glLineWidth(3.0);
// glBegin(GL_LINE_STRIP);
// glVertex2f(0,0);
// glVertex2f(1,0);
// glVertex2f(1,1);
// glVertex2f(0,1);
// glEnd();
// }
drawItemName(item);
if (item->hasSubItems())
......@@ -199,13 +184,6 @@ void FilterList::drawItem(FilterListItem* item)
drawButton(item->isOpen());
}
// glBegin(GL_POLYGON);
// glVertex2f(0,0);
// glVertex2f(1,0);
// glVertex2f(1,1);
// glVertex2f(0,1);
// glEnd();
}
void FilterList::drawItemName(FilterListItem* item)
......@@ -428,7 +406,7 @@ void FilterList::mouseDrag(const MouseEvent& e)
{
isDragging = true;
String b = fli->parentName;
String b = fli->getParentName();
b += "/";
b += fli->getName();
......@@ -526,7 +504,54 @@ void FilterListItem::setOpen(bool t)
open = t;
}
const String FilterListItem::getName()
const String& FilterListItem::getName()
{
return name;
}
\ No newline at end of file
}
const String& FilterListItem::getParentName()
{
return parentName;
}
void FilterListItem::setParentName(const String& name)
{
parentName = name;
if (parentName.equalsIgnoreCase("Processors"))
{
color = Colour(59, 59, 59);
} else if (parentName.equalsIgnoreCase("Filters"))
{
color = Colour(255, 89, 0);
} else if (parentName.equalsIgnoreCase("Sinks"))
{
color = Colour(255, 149, 0);
} else if (parentName.equalsIgnoreCase("Sources"))
{
color = Colour(255, 0, 0);
} else {
color = Colour(90, 80, 80);
}
}
// Blue slate:
// if (parentName.equalsIgnoreCase("Processors"))
// {
// color = Colour(59, 59, 59);
// } else if (parentName.equalsIgnoreCase("Filters"))
// {
// color = Colour(82, 101, 163);
// } else if (parentName.equalsIgnoreCase("Sinks"))
// {
// color = Colour(48, 61, 102);
// } else if (parentName.equalsIgnoreCase("Sources"))
// {
// color = Colour(151, 170, 230);
// } else {
// color = Colour(20, 37, 92);
// }
\ No newline at end of file
......@@ -32,7 +32,7 @@ public:
void setUIComponent(UIComponent* ui) {UI = ui;}
bool isOpen();
private:
......@@ -116,8 +116,9 @@ public:
void reverseOpenState() {open = !open;}
const String getName();
String parentName;
const String& getName();
const String& getParentName();
void setParentName(const String& name);
Colour color;
......@@ -126,6 +127,7 @@ private:
bool selected;
bool open;
const String name;
String parentName;
OwnedArray<FilterListItem> subItems;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment