SplitView bug fixes

This commit is contained in:
Jack Andersen 2016-02-01 10:04:29 -10:00
parent dde8624b6b
commit 297c59df2d
2 changed files with 15 additions and 17 deletions

View File

@ -544,7 +544,10 @@ void RootView::specialKeyDown(boo::ESpecialKey key, boo::EModifierKey mods, bool
return;
}
if (key == boo::ESpecialKey::Esc && m_splitMenuSystem.m_phase != SplitMenuSystem::Phase::Inactive)
{
m_splitMenuSystem.m_phase = SplitMenuSystem::Phase::Inactive;
return;
}
for (View* v : m_views)
v->specialKeyDown(key, mods, isRepeat);
if (m_activeTextView)

View File

@ -158,8 +158,7 @@ void Space::mouseMove(const boo::SWindowCoord& coord)
{
if (m_cornerView.m_view->m_flip)
{
m_cornerDrag = false;
rootView().unsetActiveDragView(this);
rootView().mouseUp(coord, boo::EMouseButton::Primary, boo::EModifierKey::None);
rootView().viewManager().deferSpaceSplit(&m_controller, SplitView::Axis::Vertical, 1, coord);
}
else
@ -167,8 +166,7 @@ void Space::mouseMove(const boo::SWindowCoord& coord)
SplitView* sv = findSplitViewOnSide(SplitView::Axis::Vertical, 0);
if (sv)
{
m_cornerDrag = false;
rootView().unsetActiveDragView(this);
rootView().mouseUp(coord, boo::EMouseButton::Primary, boo::EModifierKey::None);
rootView().beginInteractiveJoin(sv, coord);
}
}
@ -177,8 +175,7 @@ void Space::mouseMove(const boo::SWindowCoord& coord)
{
if (m_cornerView.m_view->m_flip)
{
m_cornerDrag = false;
rootView().unsetActiveDragView(this);
rootView().mouseUp(coord, boo::EMouseButton::Primary, boo::EModifierKey::None);
rootView().viewManager().deferSpaceSplit(&m_controller, SplitView::Axis::Horizontal, 1, coord);
}
else
@ -186,8 +183,7 @@ void Space::mouseMove(const boo::SWindowCoord& coord)
SplitView* sv = findSplitViewOnSide(SplitView::Axis::Horizontal, 0);
if (sv)
{
m_cornerDrag = false;
rootView().unsetActiveDragView(this);
rootView().mouseUp(coord, boo::EMouseButton::Primary, boo::EModifierKey::None);
rootView().beginInteractiveJoin(sv, coord);
}
}
@ -196,8 +192,7 @@ void Space::mouseMove(const boo::SWindowCoord& coord)
{
if (!m_cornerView.m_view->m_flip)
{
m_cornerDrag = false;
rootView().unsetActiveDragView(this);
rootView().mouseUp(coord, boo::EMouseButton::Primary, boo::EModifierKey::None);
rootView().viewManager().deferSpaceSplit(&m_controller, SplitView::Axis::Vertical, 0, coord);
}
else
@ -205,8 +200,7 @@ void Space::mouseMove(const boo::SWindowCoord& coord)
SplitView* sv = findSplitViewOnSide(SplitView::Axis::Vertical, 1);
if (sv)
{
m_cornerDrag = false;
rootView().unsetActiveDragView(this);
rootView().mouseUp(coord, boo::EMouseButton::Primary, boo::EModifierKey::None);
rootView().beginInteractiveJoin(sv, coord);
}
}
@ -215,8 +209,7 @@ void Space::mouseMove(const boo::SWindowCoord& coord)
{
if (!m_cornerView.m_view->m_flip)
{
m_cornerDrag = false;
rootView().unsetActiveDragView(this);
rootView().mouseUp(coord, boo::EMouseButton::Primary, boo::EModifierKey::None);
rootView().viewManager().deferSpaceSplit(&m_controller, SplitView::Axis::Horizontal, 0, coord);
}
else
@ -224,8 +217,7 @@ void Space::mouseMove(const boo::SWindowCoord& coord)
SplitView* sv = findSplitViewOnSide(SplitView::Axis::Horizontal, 1);
if (sv)
{
m_cornerDrag = false;
rootView().unsetActiveDragView(this);
rootView().mouseUp(coord, boo::EMouseButton::Primary, boo::EModifierKey::None);
rootView().beginInteractiveJoin(sv, coord);
}
}
@ -266,12 +258,15 @@ void Space::CornerView::mouseLeave(const boo::SWindowCoord& coord)
SplitView* Space::findSplitViewOnSide(SplitView::Axis axis, int side)
{
SplitView* ret = dynamic_cast<SplitView*>(&parentView());
View* test = this;
while (ret)
{
if (ret->axis() != axis)
return nullptr;
if (ret->m_views[side ^ 1].m_view == this)
if (ret->m_views[side ^ 1].m_view == test)
return ret;
else if (ret->m_views[side].m_view == test)
test = ret;
ret = dynamic_cast<SplitView*>(&ret->parentView());
}
return nullptr;