Don't allow dropping dockables onto the tabs where textures sit

This commit is contained in:
baldurk
2016-10-10 18:50:11 +02:00
parent 2507634df9
commit ea587608cb
4 changed files with 11 additions and 1 deletions
@@ -656,7 +656,7 @@ void ToolWindowManager::findSuggestions(ToolWindowManagerWrapper* wrapper) {
m_suggestions << AreaReference(side, widget);
}
}
if (area && area->rect().contains(area->mapFromGlobal(globalPos))) {
if (area && area->allowUserDrop() && area->rect().contains(area->mapFromGlobal(globalPos))) {
m_suggestions << AreaReference(AddTo, area);
}
}
@@ -35,6 +35,7 @@ ToolWindowManagerArea::ToolWindowManagerArea(ToolWindowManager *manager, QWidget
m_dragCanStart = false;
m_tabDragCanStart = false;
m_inTabMoved = false;
m_userCanDrop = true;
setMovable(true);
setTabsClosable(true);
setDocumentMode(true);
@@ -52,6 +52,11 @@ public:
*/
void addToolWindows(const QList<QWidget*>& toolWindows);
void enableUserDrop() { m_userCanDrop = true; }
void disableUserDrop() { m_userCanDrop = false; }
bool allowUserDrop() { return m_userCanDrop; }
/*!
* Returns a list of all tool windows in this area.
*/
@@ -84,6 +89,8 @@ private:
// that can be considered as dragging current tab
// if the cursor will leave the tab bar area
bool m_userCanDrop; // indictes the user is allowed to drop things on this area
bool m_inTabMoved; // if we're in the tabMoved() function (so if we call tabMove to cancel
// the movement, we shouldn't re-check the tabMoved behaviour)
+2
View File
@@ -1463,6 +1463,8 @@ void TextureViewer::SetupTextureTabs()
&TextureViewer::textureTab_Changed);
QObject::connect(textureTabs, &QTabWidget::tabCloseRequested, this,
&TextureViewer::textureTab_Closing);
textureTabs->disableUserDrop();
}
void TextureViewer::textureTab_Changed(int index)