mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-23 15:06:32 +00:00
Update to toolwindowmanager 8e36057 to get a couple of important fixes
This commit is contained in:
+10
-2
@@ -334,10 +334,18 @@ void ToolWindowManager::moveToolWindows(QList<QWidget *> toolWindows,
|
||||
newArea->setGeometry(newGeometry);
|
||||
|
||||
// Convert area percentage desired to relative sizes.
|
||||
const int totalStretch = 100;
|
||||
const int totalStretch =
|
||||
(area.type() == TopOf || area.type() == BottomOf)
|
||||
? areaGeometry.height() : areaGeometry.width();
|
||||
int pct = int(totalStretch*area.percentage());
|
||||
|
||||
splitter->setSizes({pct, totalStretch-pct});
|
||||
int a = pct;
|
||||
int b = totalStretch-pct;
|
||||
|
||||
if (area.type() == BottomOf || area.type() == RightOf)
|
||||
std::swap(a, b);
|
||||
|
||||
splitter->setSizes({a, b});
|
||||
}
|
||||
} else if (area.type() == EmptySpace) {
|
||||
ToolWindowManagerArea* newArea = createArea();
|
||||
|
||||
@@ -151,7 +151,9 @@ void ToolWindowManagerWrapper::updateTitle() {
|
||||
void ToolWindowManagerWrapper::closeEvent(QCloseEvent *) {
|
||||
QList<QWidget*> toolWindows;
|
||||
foreach(ToolWindowManagerArea* tabWidget, findChildren<ToolWindowManagerArea*>()) {
|
||||
toolWindows << tabWidget->toolWindows();
|
||||
if (ToolWindowManager::managerOf(tabWidget) == m_manager) {
|
||||
toolWindows << tabWidget->toolWindows();
|
||||
}
|
||||
}
|
||||
m_manager->moveToolWindows(toolWindows, ToolWindowManager::NoArea);
|
||||
}
|
||||
@@ -192,7 +194,9 @@ bool ToolWindowManagerWrapper::eventFilter(QObject *object, QEvent *event) {
|
||||
m_dragReady = false;
|
||||
QList<QWidget*> toolWindows;
|
||||
foreach(ToolWindowManagerArea* tabWidget, findChildren<ToolWindowManagerArea*>()) {
|
||||
toolWindows << tabWidget->toolWindows();
|
||||
if (ToolWindowManager::managerOf(tabWidget) == m_manager) {
|
||||
toolWindows << tabWidget->toolWindows();
|
||||
}
|
||||
}
|
||||
m_manager->startDrag(toolWindows, this);
|
||||
}
|
||||
@@ -280,7 +284,9 @@ bool ToolWindowManagerWrapper::eventFilter(QObject *object, QEvent *event) {
|
||||
m_dragStartGeometry = geometry();
|
||||
QList<QWidget*> toolWindows;
|
||||
foreach(ToolWindowManagerArea* tabWidget, findChildren<ToolWindowManagerArea*>()) {
|
||||
toolWindows << tabWidget->toolWindows();
|
||||
if (ToolWindowManager::managerOf(tabWidget) == m_manager) {
|
||||
toolWindows << tabWidget->toolWindows();
|
||||
}
|
||||
}
|
||||
m_manager->startDrag(toolWindows, this);
|
||||
} else if (event->type() == QEvent::Move && m_dragActive) {
|
||||
|
||||
Reference in New Issue
Block a user