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

Allow control panel to collapse gracefully

parent 15065009
No related branches found
No related tags found
No related merge requests found
...@@ -525,7 +525,7 @@ void ControlPanel::resized() ...@@ -525,7 +525,7 @@ void ControlPanel::resized()
if (playButton != 0) if (playButton != 0)
{ {
if (w > 350) if (w > 330)
playButton->setBounds(w-h*10,5,h-5,h-10);\ playButton->setBounds(w-h*10,5,h-5,h-10);\
else else
playButton->setBounds(5,5,h-5,h-10);\ playButton->setBounds(5,5,h-5,h-10);\
...@@ -533,7 +533,7 @@ void ControlPanel::resized() ...@@ -533,7 +533,7 @@ void ControlPanel::resized()
if (recordButton != 0) if (recordButton != 0)
{ {
if (w > 350) if (w > 330)
recordButton->setBounds(w-h*9,5,h-5,h-10); recordButton->setBounds(w-h*9,5,h-5,h-10);
else else
recordButton->setBounds(5+h,5,h-5,h-10); recordButton->setBounds(5+h,5,h-5,h-10);
...@@ -541,18 +541,27 @@ void ControlPanel::resized() ...@@ -541,18 +541,27 @@ void ControlPanel::resized()
if (masterClock != 0) if (masterClock != 0)
{ {
if (w > 350) if (w > 330)
masterClock->setBounds(w-h*7-15,0,h*7-15,h); masterClock->setBounds(w-h*7-15,0,h*7-15,h);
else else
masterClock->setBounds(5+h*2+15,0,h*7-15,h); masterClock->setBounds(5+h*2+15,0,h*7-15,h);
} }
int offset1 = 750 - getWidth();
if (offset1 > h)
offset1 = h;
int offset2 = 570 - getWidth();
if (offset2 > h)
offset2 = h;
if (cpuMeter != 0) if (cpuMeter != 0)
{ {
if (getWidth() < 750 && getWidth() >= 570) if (getWidth() < 750 && getWidth() >= 570)
cpuMeter->setBounds(8,h/4+h,h*3,h/2); cpuMeter->setBounds(8,h/4+offset1,h*3,h/2);
else if (getWidth() < 570) else if (getWidth() < 570)
cpuMeter->setBounds(8,h/4+h*2,h*3,h/2); cpuMeter->setBounds(8,h/4+offset1+offset2,h*3,h/2);
else else
cpuMeter->setBounds(8,h/4,h*3,h/2); cpuMeter->setBounds(8,h/4,h*3,h/2);
} }
...@@ -560,9 +569,9 @@ void ControlPanel::resized() ...@@ -560,9 +569,9 @@ void ControlPanel::resized()
if (diskMeter != 0) if (diskMeter != 0)
{ {
if (getWidth() < 750 && getWidth() >= 570) if (getWidth() < 750 && getWidth() >= 570)
diskMeter->setBounds(16+h*3,h/4+h,h*3,h/2); diskMeter->setBounds(16+h*3,h/4+offset1,h*3,h/2);
else if (getWidth() < 570) else if (getWidth() < 570)
diskMeter->setBounds(16+h*3,h/4+h*2,h*3,h/2); diskMeter->setBounds(16+h*3,h/4+offset1+offset2,h*3,h/2);
else else
diskMeter->setBounds(16+h*3,h/4,h*3,h/2); diskMeter->setBounds(16+h*3,h/4,h*3,h/2);
...@@ -573,7 +582,7 @@ void ControlPanel::resized() ...@@ -573,7 +582,7 @@ void ControlPanel::resized()
if (getWidth() < 750 && getWidth() >= 570) if (getWidth() < 750 && getWidth() >= 570)
audioEditor->setBounds(w-526,5,h*8,h-10); audioEditor->setBounds(w-526,5,h*8,h-10);
else if (getWidth() < 570) else if (getWidth() < 570)
audioEditor->setBounds(8,5+h,h*8,h-10); audioEditor->setBounds(8,5+offset2,h*8,h-10);
else else
audioEditor->setBounds(h*7,5,h*8,h-10); audioEditor->setBounds(h*7,5,h*8,h-10);
} }
......
...@@ -120,14 +120,22 @@ void UIComponent::resized() ...@@ -120,14 +120,22 @@ void UIComponent::resized()
{ {
editorViewportButton->setBounds(w-230, h-40, 225, 35); editorViewportButton->setBounds(w-230, h-40, 225, 35);
if (h < 400) if (h < 300 && editorViewportButton->isOpen())
editorViewportButton->setVisible(false); editorViewportButton->toggleState();
else
editorViewportButton->setVisible(true); if (h < 200)
editorViewportButton->setBounds(w-230,h-40+200-h,225,35);
//else
// editorViewportButton->setVisible(true);
} }
if (editorViewport != 0) if (editorViewport != 0)
{ {
//if (h < 400)
// editorViewport->setVisible(false);
//else
// editorViewport->setVisible(true);
if (editorViewportButton->isOpen() && !editorViewport->isVisible()) if (editorViewportButton->isOpen() && !editorViewport->isVisible())
editorViewport->setVisible(true); editorViewport->setVisible(true);
else if (!editorViewportButton->isOpen() && editorViewport->isVisible()) else if (!editorViewportButton->isOpen() && editorViewport->isVisible())
...@@ -135,10 +143,7 @@ void UIComponent::resized() ...@@ -135,10 +143,7 @@ void UIComponent::resized()
editorViewport->setBounds(6,h-190,w-11,150); editorViewport->setBounds(6,h-190,w-11,150);
if (h < 400)
editorViewport->setVisible(false);
else
editorViewport->setVisible(true);
} }
if (controlPanel != 0) if (controlPanel != 0)
...@@ -149,18 +154,28 @@ void UIComponent::resized() ...@@ -149,18 +154,28 @@ void UIComponent::resized()
int leftBound; int leftBound;
if (w >= 460){ if (w >= 460){
leftBound = 210; leftBound = 202;
} }
else { else {
leftBound = w-250; leftBound = w-258;
controlPanelWidth = w-leftBound; controlPanelWidth = w-leftBound;
} }
if (controlPanelWidth < 750) if (controlPanelWidth < 750)
addHeight += 32; {
addHeight = 750-controlPanelWidth;
if (addHeight > 32)
addHeight = 32;
}
if (controlPanelWidth < 570) if (controlPanelWidth < 570)
addHeight += 32; {
addHeight = 32 + 570-controlPanelWidth;
if (addHeight > 64)
addHeight = 64;
}
if (controlPanel->isOpen()) if (controlPanel->isOpen())
controlPanel->setBounds(leftBound,6,controlPanelWidth,64+addHeight); controlPanel->setBounds(leftBound,6,controlPanelWidth,64+addHeight);
...@@ -168,6 +183,20 @@ void UIComponent::resized() ...@@ -168,6 +183,20 @@ void UIComponent::resized()
controlPanel->setBounds(leftBound,6,controlPanelWidth,32+addHeight); controlPanel->setBounds(leftBound,6,controlPanelWidth,32+addHeight);
} }
if (processorList != 0)
{
if (processorList->isOpen())
if (editorViewportButton->isOpen())
processorList->setBounds(5,5,195,h-200);
else
processorList->setBounds(5,5,195,h-50);
else
processorList->setBounds(5,5,195,34);
if (w < 460)
processorList->setBounds(5-460+getWidth(),5,195,processorList->getHeight());
}
if (dataViewport != 0) if (dataViewport != 0)
{ {
int left, top, width, height; int left, top, width, height;
...@@ -175,7 +204,7 @@ void UIComponent::resized() ...@@ -175,7 +204,7 @@ void UIComponent::resized()
top = 40; top = 40;
if (processorList->isOpen()) if (processorList->isOpen())
left = 202; left = processorList->getX()+processorList->getWidth()+2;
else else
left = 6; left = 6;
...@@ -197,29 +226,15 @@ void UIComponent::resized() ...@@ -197,29 +226,15 @@ void UIComponent::resized()
} }
if (processorList != 0)
{
if (processorList->isOpen())
if (editorViewportButton->isOpen())
processorList->setBounds(5,5,195,h-200);
else
processorList->setBounds(5,5,195,h-50);
else
processorList->setBounds(5,5,195,34);
if (w < 460)
processorList->setVisible(false);
else
processorList->setVisible(true);
}
if (messageCenter != 0) if (messageCenter != 0)
{ {
messageCenter->setBounds(6,h-35,w-241,30); messageCenter->setBounds(6,h-35,w-241,30);
if (h < 400) if (h < 200)
messageCenter->setVisible(false); messageCenter->setBounds(6,h-35+200-h,w-241,30);
else // else
messageCenter->setVisible(true); // messageCenter->setVisible(true);
} }
// for debugging qpurposes: // for debugging qpurposes:
......
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