# HG changeset patch # User Chris Cannam # Date 1138385047 0 # Node ID 46d8f5add6f04ba63db340ac14f5bf780e1f2193 # Parent 7c767d41bceeba5080aa30a2899e70f2061152a6 * Introduce potentially-separate read and write ring buffers, so we can swap in a new set when something changes -- thus allowing us to respond quickly when something changes during playback, without losing the long buffers * Some fixes for display & editing diff -r 7c767d41bcee -r 46d8f5add6f0 widgets/Pane.cpp --- a/widgets/Pane.cpp Thu Jan 26 18:01:38 2006 +0000 +++ b/widgets/Pane.cpp Fri Jan 27 18:04:07 2006 +0000 @@ -227,12 +227,14 @@ } if (m_clickedInRange && m_shiftPressed) { - //!!! be nice if this looked a bit more in keeping with the - //selection block - paint.setPen(Qt::blue); - paint.drawRect(m_clickPos.x(), m_clickPos.y(), - m_mousePos.x() - m_clickPos.x(), - m_mousePos.y() - m_clickPos.y()); + if (m_manager && (m_manager->getToolMode() == ViewManager::NavigateMode)) { + //!!! be nice if this looked a bit more in keeping with the + //selection block + paint.setPen(Qt::blue); + paint.drawRect(m_clickPos.x(), m_clickPos.y(), + m_mousePos.x() - m_clickPos.x(), + m_mousePos.y() - m_clickPos.y()); + } } paint.end(); @@ -578,6 +580,7 @@ Layer *layer = getSelectedLayer(); if (layer) { layer->drawDrag(e); + update(); } } else if (mode == ViewManager::EditMode) { @@ -585,6 +588,7 @@ Layer *layer = getSelectedLayer(); if (layer) { layer->editDrag(e); + update(); } } } @@ -680,7 +684,7 @@ break; case ViewManager::EditMode: - setCursor(Qt::SizeAllCursor); + setCursor(Qt::UpArrowCursor); break; case ViewManager::DrawMode: diff -r 7c767d41bcee -r 46d8f5add6f0 widgets/PaneStack.cpp --- a/widgets/PaneStack.cpp Thu Jan 26 18:01:38 2006 +0000 +++ b/widgets/PaneStack.cpp Fri Jan 27 18:04:07 2006 +0000 @@ -157,6 +157,37 @@ emit currentPaneChanged(m_currentPane); } +void +PaneStack::setCurrentLayer(Pane *pane, Layer *layer) // may be null +{ + setCurrentPane(pane); + + if (m_currentPane) { + + std::vector::iterator i = m_panes.begin(); + std::vector::iterator j = m_propertyStacks.begin(); + + while (i != m_panes.end()) { + + if (*i == pane) { + PropertyStack *stack = dynamic_cast(*j); + if (stack) { + if (stack->containsContainer(layer)) { + stack->setCurrentIndex(stack->getContainerIndex(layer)); + emit currentLayerChanged(pane, layer); + } else { + stack->setCurrentIndex(stack->getContainerIndex(pane)); + emit currentLayerChanged(pane, 0); + } + } + break; + } + ++i; + ++j; + } + } +} + Pane * PaneStack::getCurrentPane() { diff -r 7c767d41bcee -r 46d8f5add6f0 widgets/PaneStack.h --- a/widgets/PaneStack.h Thu Jan 26 18:01:38 2006 +0000 +++ b/widgets/PaneStack.h Fri Jan 27 18:04:07 2006 +0000 @@ -34,6 +34,7 @@ int getPaneCount() const; void setCurrentPane(Pane *pane); + void setCurrentLayer(Pane *pane, Layer *layer); Pane *getCurrentPane(); signals: diff -r 7c767d41bcee -r 46d8f5add6f0 widgets/PropertyStack.cpp --- a/widgets/PropertyStack.cpp Thu Jan 26 18:01:38 2006 +0000 +++ b/widgets/PropertyStack.cpp Fri Jan 27 18:04:07 2006 +0000 @@ -95,6 +95,17 @@ return false; } +int +PropertyStack::getContainerIndex(PropertyContainer *pc) const +{ + for (size_t i = 0; i < m_client->getPropertyContainerCount(); ++i) { + PropertyContainer *container = m_client->getPropertyContainer(i); + if (pc == container) return i; + } + + return false; +} + void PropertyStack::propertyContainerAdded(PropertyContainer *) { diff -r 7c767d41bcee -r 46d8f5add6f0 widgets/PropertyStack.h --- a/widgets/PropertyStack.h Thu Jan 26 18:01:38 2006 +0000 +++ b/widgets/PropertyStack.h Fri Jan 27 18:04:07 2006 +0000 @@ -27,6 +27,7 @@ PropertyStack(QWidget *parent, View *client); bool containsContainer(PropertyContainer *container) const; + int getContainerIndex(PropertyContainer *container) const; signals: void propertyContainerSelected(PropertyContainer *container);