# HG changeset patch # User Chris Cannam # Date 1202319653 0 # Node ID 6167a28d25fcc2eff5bba06d68f97b7445cf2fb6 # Parent a9dfa2d6d5acb5cee7b6bc80f0c18d8ae7baa746 * line up overview widget nicely with main pane (at least on first startup) * fix #1878396 renaming layer seems to have no visible effect * comment out some debug output diff -r a9dfa2d6d5ac -r 6167a28d25fc layer/Layer.cpp --- a/layer/Layer.cpp Wed Feb 06 16:21:29 2008 +0000 +++ b/layer/Layer.cpp Wed Feb 06 17:40:53 2008 +0000 @@ -68,10 +68,16 @@ (LayerFactory::getInstance()->getLayerType(this)); } +void +Layer::setPresentationName(QString name) +{ + m_presentationName = name; +} + QString Layer::getLayerPresentationName() const { -// QString layerName = objectName(); + if (m_presentationName != "") return m_presentationName; LayerFactory *factory = LayerFactory::getInstance(); QString layerName = factory->getLayerPresentationName @@ -588,6 +594,11 @@ { stream << indent; + if (m_presentationName != "") { + extraAttributes = QString("%1 presentationName=\"%2\"") + .arg(extraAttributes).arg(encodeEntities(m_presentationName)); + } + stream << QString("getLayerTypeName (LayerFactory::getInstance()->getLayerType(this)))) @@ -617,6 +628,11 @@ { stream << indent; + if (m_presentationName != "") { + extraAttributes = QString("%1 presentationName=\"%2\"") + .arg(extraAttributes).arg(encodeEntities(m_presentationName)); + } + stream << QString("\n") .arg(encodeEntities(LayerFactory::getInstance()->getLayerTypeName (LayerFactory::getInstance()->getLayerType(this)))) diff -r a9dfa2d6d5ac -r 6167a28d25fc layer/Layer.h --- a/layer/Layer.h Wed Feb 06 16:21:29 2008 +0000 +++ b/layer/Layer.h Wed Feb 06 17:40:53 2008 +0000 @@ -92,9 +92,12 @@ virtual QString getPropertyContainerIconName() const; virtual QString getPropertyContainerName() const { - return objectName(); + if (m_presentationName != "") return m_presentationName; + else return objectName(); } + virtual void setPresentationName(QString name); + virtual QString getLayerPresentationName() const; virtual QPixmap getLayerPresentationPixmap(QSize) const { return QPixmap(); } @@ -545,6 +548,8 @@ void paintMeasurementRect(View *v, QPainter &paint, const MeasureRect &r, bool focus) const; + QString m_presentationName; + private: mutable QMutex m_dormancyMutex; mutable std::map m_dormancy; diff -r a9dfa2d6d5ac -r 6167a28d25fc view/Pane.cpp --- a/view/Pane.cpp Wed Feb 06 16:21:29 2008 +0000 +++ b/view/Pane.cpp Wed Feb 06 17:40:53 2008 +0000 @@ -50,6 +50,8 @@ #include "widgets/KeyReference.h" //!!! should probably split KeyReference into a data class in base and another that shows the widget +//#define DEBUG_PANE + using std::cerr; using std::endl; @@ -1701,9 +1703,11 @@ } else { newCentreFrame = 0; } - + +#ifdef DEBUG_PANE std::cerr << "Pane::dragTopLayer: newCentreFrame = " << newCentreFrame << ", models end frame = " << getModelsEndFrame() << std::endl; +#endif if (newCentreFrame >= getModelsEndFrame()) { newCentreFrame = getModelsEndFrame(); diff -r a9dfa2d6d5ac -r 6167a28d25fc view/PaneStack.cpp --- a/view/PaneStack.cpp Wed Feb 06 16:21:29 2008 +0000 +++ b/view/PaneStack.cpp Wed Feb 06 17:40:53 2008 +0000 @@ -495,14 +495,7 @@ std::cerr << "PaneStack::sizePropertyStacks: max min width " << maxMinWidth << std::endl; #endif -//#ifdef Q_WS_MAC - // This is necessary to compensate for cb->setMinimumSize(10, 10) - // in PropertyBox in the Mac version (to avoid a mysterious crash) - // ... no longer necessary with qt4.2 -// int setWidth = maxMinWidth * 3 / 2; -//#else int setWidth = maxMinWidth; -//#endif m_propertyStackStack->setMaximumWidth(setWidth + 10); @@ -511,6 +504,7 @@ m_panes[i].propertyStack->setMinimumWidth(setWidth); } + emit propertyStacksResized(setWidth); emit propertyStacksResized(); } diff -r a9dfa2d6d5ac -r 6167a28d25fc view/PaneStack.h --- a/view/PaneStack.h Wed Feb 06 16:21:29 2008 +0000 +++ b/view/PaneStack.h Wed Feb 06 17:40:53 2008 +0000 @@ -74,6 +74,7 @@ void currentPaneChanged(Pane *pane); void currentLayerChanged(Pane *pane, Layer *layer); void rightButtonMenuRequested(Pane *pane, QPoint position); + void propertyStacksResized(int width); void propertyStacksResized(); void contextHelpChanged(const QString &); diff -r a9dfa2d6d5ac -r 6167a28d25fc view/View.cpp --- a/view/View.cpp Wed Feb 06 16:21:29 2008 +0000 +++ b/view/View.cpp Wed Feb 06 17:40:53 2008 +0000 @@ -892,8 +892,10 @@ { if (m_followPan) { size_t f = alignFromReference(rf); +#ifdef DEBUG_VIEW_WIDGET_PAINT std::cerr << "View[" << this << "]::globalCentreFrameChanged(" << rf << "): setting centre frame to " << f << std::endl; +#endif setCentreFrame(f, false); } } diff -r a9dfa2d6d5ac -r 6167a28d25fc view/ViewManager.cpp --- a/view/ViewManager.cpp Wed Feb 06 16:21:29 2008 +0000 +++ b/view/ViewManager.cpp Wed Feb 06 17:40:53 2008 +0000 @@ -24,7 +24,7 @@ #include -#define DEBUG_VIEW_MANAGER 1 +//#define DEBUG_VIEW_MANAGER 1 ViewManager::ViewManager() : m_playSource(0),