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

Aesthetic upgrades to FilterViewport and GenericEditor

Generic Editors colors now match the type of processor.
The FilterViewport layout has been changed to a simple outline.
parent d37979fa
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
<PROCESSORGRAPH>
<SIGNALCHAIN>
<PROCESSOR name="Sources/Intan Demo Board" insertionPoint="0"/>
<PROCESSOR name="Sources/Signal Generator" insertionPoint="0"/>
<PROCESSOR name="Sinks/LFP Viewer" insertionPoint="1"/>
</SIGNALCHAIN>
</PROCESSORGRAPH>
<?xml version="1.0" encoding="UTF-8"?>
<MAINWINDOW>
<BOUNDS x="488" y="277" w="1036" h="798" fullscreen="0"/>
<BOUNDS x="1736" y="52" w="1293" h="968" fullscreen="0"/>
</MAINWINDOW>
......@@ -26,7 +26,14 @@ GenericEditor::GenericEditor (GenericProcessor* owner, FilterViewport* vp)
//titleFont->setTypefaceName(T("Miso"));
backgroundColor = Colour(3, 143, 255);
if (owner->isSource())
backgroundColor = 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));
else if (owner->isSplitter() || owner->isMerger())
backgroundColor = 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));
}
......@@ -125,8 +132,8 @@ void GenericEditor::paint (Graphics& g)
GenericProcessor* p = (GenericProcessor*) getProcessor();
g.setColour(Colour(127,137,147));
g.fillAll();
//g.setColour(Colour(127,137,147));
//g.fillAll();
if (isSelected)
g.setColour(Colours::yellow);
......
......@@ -14,7 +14,7 @@ FilterViewport::FilterViewport(ProcessorGraph* pgraph, DataViewport* tcomp)
: message ("Drag-and-drop some rows from the top-left box onto this component!"),
somethingIsBeingDraggedOver (false), graph(pgraph), tabComponent(tcomp), shiftDown(false),
insertionPoint(0), componentWantsToMove(false), indexOfMovingComponent(-1),
borderSize(6), tabSize(20), tabButtonSize(15), canEdit(true)//, signalChainNeedsSource(true)
borderSize(6), tabSize(30), tabButtonSize(15), canEdit(true)//, signalChainNeedsSource(true)
{
addMouseListener(this, true);
......@@ -44,20 +44,26 @@ void FilterViewport::paint (Graphics& g)
if (somethingIsBeingDraggedOver)
{
g.setColour (Colours::magenta);
g.setColour (Colours::yellow);
} else {
g.setColour (Colour(48,48,48));
}
g.fillRect (0, 0, getWidth(), getHeight());
g.drawRect (0, 0, getWidth(), getHeight(), 2.0);
g.drawVerticalLine(tabSize, 0, getHeight());
for (int n = 0; n < 5; n++)
{
g.drawEllipse(6,(tabSize-2)*n+8,tabSize-10,tabSize-10,1.0);
}
//g.fillRoundedRectangle (tabSize, 0, getWidth(), getHeight(), 8);
g.setColour (Colour(170,178,183));
g.fillRect (tabSize+borderSize,borderSize,
getWidth()-borderSize*2-tabSize,
getHeight()-borderSize*2);
//g.setColour (Colour(170,178,183));
//g.fillRect (tabSize+borderSize,borderSize,
// getWidth()-borderSize*2-tabSize,
// getHeight()-borderSize*2);
if (somethingIsBeingDraggedOver)
{
......@@ -216,10 +222,12 @@ void FilterViewport::createNewTab(GenericEditor* editor)
SignalChainTabButton* t = new SignalChainTabButton();
t->setEditor(editor);
t->setBounds(0,(tabButtonSize+5)*(index),
tabButtonSize,tabButtonSize);
t->setBounds(6,(tabSize-2)*(index)+8,tabSize-10,tabSize-10);
// t->setBounds(0,(tabButtonSize+5)*(index),
// tabButtonSize,tabButtonSize);
addAndMakeVisible(t);
signalChainArray.add(t);
editor->tabNumber(signalChainArray.size()-1);
t->setToggleState(true,false);
t->setNumber(index);
......@@ -233,8 +241,7 @@ void FilterViewport::removeTab(int tabIndex)
for (int n = 0; n < signalChainArray.size(); n++)
{
signalChainArray[n]->setBounds(0,(tabButtonSize+5)*n,
tabButtonSize,tabButtonSize);
signalChainArray[n]->setBounds(6,(tabSize-2)*n+8,tabSize-10,tabSize-10);
int tNum = signalChainArray[n]->getEditor()->tabNumber();
......@@ -503,7 +510,9 @@ void FilterViewport::refreshEditors () {
{
if (!editorArray[n]->getEnabledState())
{
lastBound += borderSize*3;
GenericProcessor* p = (GenericProcessor*) editorArray[n]->getProcessor();
if (!p->isSource())
lastBound += borderSize*3;
// signalChainNeedsSource = true;
} else {
// signalChainNeedsSource = false;
......@@ -731,7 +740,7 @@ SignalChainTabButton::SignalChainTabButton() : Button("Name"),
//setToggleState(false,true);
setClickingTogglesState(true);
MemoryInputStream mis(BinaryData::misoserialized, BinaryData::misoserializedSize, false);
MemoryInputStream mis(BinaryData::silkscreenserialized, BinaryData::silkscreenserializedSize, false);
Typeface::Ptr typeface = new CustomTypeface(mis);
buttonFont = Font(typeface);
buttonFont.setHeight(14);
......@@ -753,7 +762,7 @@ void SignalChainTabButton::clicked()
void SignalChainTabButton::paintButton(Graphics &g, bool isMouseOver, bool isButtonDown)
{
if (getToggleState() == true)
g.setColour(Colours::teal);
g.setColour(Colours::orange);
else
g.setColour(Colours::darkgrey);
......
......@@ -198,7 +198,7 @@ void FilterViewportButton::renderOpenGL()
void FilterViewportButton::drawName()
{
glColor4f(1.0f,1.0f,1.0f,1.0f);
glRasterPos2f(5.0/getWidth(),0.75f);
glRasterPos2f(8.0/getWidth(),0.75f);
font->FaceSize(23);
font->Render("SIGNAL CHAIN");
......
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