mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-12 04:50:35 +00:00
Don't allow dropping dockables onto the tabs where textures sit
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user