SplitSpace updates

This commit is contained in:
Jack Andersen 2016-01-11 14:46:27 -10:00
parent 42c96e952e
commit c826fc58ab
7 changed files with 15 additions and 12 deletions

View File

@ -176,7 +176,6 @@ class ResourceBrowser : public Space, public Specter::IPathButtonsBinding
commitResources(res); commitResources(res);
m_pathButtons.m_view.reset(new Specter::PathButtons(res, *this, ro)); m_pathButtons.m_view.reset(new Specter::PathButtons(res, *this, ro));
m_fileListing.m_view.reset(new Specter::Table(res, *this, &ro.m_fileListingBind, &ro.m_fileListingBind, 3)); m_fileListing.m_view.reset(new Specter::Table(res, *this, &ro.m_fileListingBind, &ro.m_fileListingBind, 3));
printf("New ResView: %p\n", this);
} }
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub); void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub);

View File

@ -34,12 +34,13 @@ Specter::View* RootSpace::buildSpaceView(Specter::ViewResources& res)
Specter::View* SplitSpace::buildContentView(Specter::ViewResources& res) Specter::View* SplitSpace::buildContentView(Specter::ViewResources& res)
{ {
m_splitView.reset(new Specter::SplitView(res, m_vm.rootView(), m_state.axis)); int clearance = res.pixelFactor() * SPECTER_TOOLBAR_GAUGE;
m_splitView.reset(new Specter::SplitView(res, m_vm.rootView(), this, m_state.axis,
m_state.split, clearance, clearance));
if (m_slots[0]) if (m_slots[0])
m_splitView->setContentView(0, m_slots[0]->buildSpaceView(res)); m_splitView->setContentView(0, m_slots[0]->buildSpaceView(res));
if (m_slots[1]) if (m_slots[1])
m_splitView->setContentView(1, m_slots[1]->buildSpaceView(res)); m_splitView->setContentView(1, m_slots[1]->buildSpaceView(res));
m_splitView->setSplit(m_state.split);
return m_splitView.get(); return m_splitView.get();
} }

View File

@ -244,16 +244,15 @@ public:
std::unique_ptr<Space> exchangeSpaceSplitJoin(Space* removeSpace, std::unique_ptr<Space>&& keepSpace); std::unique_ptr<Space> exchangeSpaceSplitJoin(Space* removeSpace, std::unique_ptr<Space>&& keepSpace);
Specter::SplitView* splitView() {return m_splitView.get();} Specter::SplitView* splitView() {return m_splitView.get();}
void setSplit(float split) void updateSplit(float split) {m_state.split = split;}
{
m_state.split = split;
reloadState();
}
void setAxis(Specter::SplitView::Axis axis) void setAxis(Specter::SplitView::Axis axis)
{ {
m_state.axis = axis; m_state.axis = axis;
reloadState(); reloadState();
} }
Specter::SplitView::Axis axis() const {return m_state.axis;}
float split() const {return m_state.split;}
}; };
class TestSpace : public Space class TestSpace : public Space

View File

@ -139,7 +139,8 @@ bool ViewManager::proc()
if (m_deferSplit) if (m_deferSplit)
{ {
m_deferSplit->spaceSplit(m_deferSplitAxis, m_deferSplitThisSlot); SplitSpace* ss = static_cast<SplitSpace*>(m_deferSplit->spaceSplit(m_deferSplitAxis, m_deferSplitThisSlot));
m_rootView->startSplitDrag(ss->splitView(), m_deferSplitCoord);
m_deferSplit = nullptr; m_deferSplit = nullptr;
} }

View File

@ -52,6 +52,7 @@ class ViewManager : public Specter::IViewManager
Space* m_deferSplit = nullptr; Space* m_deferSplit = nullptr;
Specter::SplitView::Axis m_deferSplitAxis; Specter::SplitView::Axis m_deferSplitAxis;
int m_deferSplitThisSlot; int m_deferSplitThisSlot;
boo::SWindowCoord m_deferSplitCoord;
public: public:
ViewManager(HECL::Runtime::FileStoreManager& fileMgr, HECL::CVarManager& cvarMgr); ViewManager(HECL::Runtime::FileStoreManager& fileMgr, HECL::CVarManager& cvarMgr);
@ -68,11 +69,13 @@ public:
HECL::Database::Project* project() {return m_projManager.project();} HECL::Database::Project* project() {return m_projManager.project();}
const Specter::Translator* getTranslator() const {return &m_translator;} const Specter::Translator* getTranslator() const {return &m_translator;}
void deferSpaceSplit(Specter::ISpaceController* split, Specter::SplitView::Axis axis, int thisSlot) void deferSpaceSplit(Specter::ISpaceController* split, Specter::SplitView::Axis axis, int thisSlot,
const boo::SWindowCoord& coord)
{ {
m_deferSplit = static_cast<Space*>(split); m_deferSplit = static_cast<Space*>(split);
m_deferSplitAxis = axis; m_deferSplitAxis = axis;
m_deferSplitThisSlot = thisSlot; m_deferSplitThisSlot = thisSlot;
m_deferSplitCoord = coord;
} }
const std::vector<HECL::SystemString>* recentProjects() const {return &m_recentProjects;} const std::vector<HECL::SystemString>* recentProjects() const {return &m_recentProjects;}

2
hecl

@ -1 +1 @@
Subproject commit 08bfbddf4db2f4018e8b494aff83795c74857eb7 Subproject commit f9edbe58261c36b9e7f02a3f6c6d07708187cd25

@ -1 +1 @@
Subproject commit 77c8e7e4b9317943abfd4366f5f38abf7185dba4 Subproject commit b1a8603a85ebc0b762a30391e1db5b43d93215b9