Add property to ToolWindowManager to disallow docking to float windows

This commit is contained in:
baldurk
2015-07-10 16:38:43 +02:00
parent c1344c2ff3
commit 227e6feddd
2 changed files with 19 additions and 2 deletions
@@ -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");