Toolbar positioning fix

This commit is contained in:
Jack Andersen 2016-02-29 17:07:58 -10:00
parent 4197cd69dc
commit 82e7005c41
3 changed files with 13 additions and 6 deletions

View File

@ -70,11 +70,7 @@ public:
void setMultiplyColor(const Zeus::CColor& color);
/* Fill all available space in container when requested */
void containerResized(const boo::SWindowRect& root, const boo::SWindowRect& sub)
{
if (m_fillContainer)
View::resized(root, sub);
}
void containerResized(const boo::SWindowRect& root, const boo::SWindowRect& sub);
};
}

View File

@ -1,5 +1,6 @@
#include "Specter/PathButtons.hpp"
#include "Specter/RootView.hpp"
#include "Specter/ViewResources.hpp"
namespace Specter
{
@ -73,6 +74,16 @@ void PathButtons::ContentView::resized(const boo::SWindowRect& root, const boo::
}
}
void PathButtons::containerResized(const boo::SWindowRect& root, const boo::SWindowRect& sub)
{
if (m_fillContainer)
{
boo::SWindowRect fillRect = sub;
fillRect.size[1] = 20 * rootView().viewRes().pixelFactor();
View::resized(root, fillRect);
}
}
void PathButtons::ContentView::draw(boo::IGraphicsCommandQueue* gfxQ)
{
gfxQ->setScissor(m_scissorRect);

View File

@ -139,9 +139,9 @@ void Toolbar::resized(const boo::SWindowRect& root, const boo::SWindowRect& sub)
float gaugeUnit = rootView().viewRes().pixelFactor() * SPECTER_TOOLBAR_GAUGE;
float yOff = 0.0;
boo::SWindowRect childRect = sub;
for (std::vector<ViewChild<View*>>& u : m_children)
{
boo::SWindowRect childRect = sub;
boo::SWindowRect containRect = sub;
containRect.location[0] += m_padding;
containRect.size[0] -= m_padding * 2;