mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 13:20:54 +00:00
Add property to ToolWindowManager to disallow docking to float windows
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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<AreaReference> 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)
|
||||
|
||||
Reference in New Issue
Block a user