diff --git a/qrenderdoc/3rdparty/toolwindowmanager/ToolWindowManager.cpp b/qrenderdoc/3rdparty/toolwindowmanager/ToolWindowManager.cpp index e5680b843..f59c51625 100644 --- a/qrenderdoc/3rdparty/toolwindowmanager/ToolWindowManager.cpp +++ b/qrenderdoc/3rdparty/toolwindowmanager/ToolWindowManager.cpp @@ -65,6 +65,7 @@ ToolWindowManager::ToolWindowManager(QWidget *parent) : this, SLOT(showNextDropSuggestion())); m_dropSuggestionSwitchTimer.setInterval(1000); m_dropCurrentSuggestionIndex = 0; + m_allowFloatingWindow = true; m_rectRubberBand = new QRubberBand(QRubberBand::Rectangle, this); m_lineRubberBand = new QRubberBand(QRubberBand::Line, this); @@ -228,6 +229,10 @@ void ToolWindowManager::setRubberBandLineWidth(int pixels) { m_rubberBandLineWidth = pixels; } +void ToolWindowManager::setAllowFloatingWindow(bool allow) { + m_allowFloatingWindow = allow; +} + QVariant ToolWindowManager::saveState() { QVariantMap result; result["toolWindowManagerStateFormat"] = 1; @@ -639,8 +644,8 @@ void ToolWindowManager::finishDrag() { return; } if (m_suggestions.isEmpty()) { - moveToolWindows(m_draggedToolWindows, NewFloatingArea); - + if (m_allowFloatingWindow) + moveToolWindows(m_draggedToolWindows, NewFloatingArea); } else { if (m_dropCurrentSuggestionIndex >= m_suggestions.count()) { qWarning("invalid m_dropCurrentSuggestionIndex"); diff --git a/qrenderdoc/3rdparty/toolwindowmanager/ToolWindowManager.h b/qrenderdoc/3rdparty/toolwindowmanager/ToolWindowManager.h index 5c9968371..d3f9cb66d 100644 --- a/qrenderdoc/3rdparty/toolwindowmanager/ToolWindowManager.h +++ b/qrenderdoc/3rdparty/toolwindowmanager/ToolWindowManager.h @@ -82,6 +82,15 @@ class ToolWindowManager : public QWidget { * */ Q_PROPERTY(int rubberBandLineWidth READ rubberBandLineWidth WRITE setRubberBandLineWidth) + /*! + * \brief Whether or not to allow floating windows to be created. + * + * Default value is to allow it. + * + * Access functions: allowFloatingWindow, setAllowFloatingWindow. + * + */ + Q_PROPERTY(int allowFloatingWindow READ allowFloatingWindow WRITE setAllowFloatingWindow) public: /*! @@ -217,6 +226,8 @@ public: void setBorderSensitivity(int pixels); void setRubberBandLineWidth(int pixels); int rubberBandLineWidth() { return m_rubberBandLineWidth; } + void setAllowFloatingWindow(bool pixels); + bool allowFloatingWindow() { return m_allowFloatingWindow; } /*! \endcond */ /*! @@ -249,6 +260,7 @@ private: QRubberBand* m_rectRubberBand; // placeholder objects used for displaying drop suggestions QRubberBand* m_lineRubberBand; + bool m_allowFloatingWindow; // Allow floating windows from this docking area QList m_suggestions; //full list of suggestions for current cursor position int m_dropCurrentSuggestionIndex; // index of currently displayed drop suggestion // (e.g. always 0 if there is only one possible drop location)