mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-26 08:26:50 +00:00
Add custom properties to ToolWindowManager toolwindows, update titles
* Two properties added - DisallowUserDocking which completely prevents a toolwindow from being dragged or docked other than programmatically. * HideCloseButton also hides the close button that normally appears on the tabs created * Also tabs now watch for title change signals and update the titles in tabs.
This commit is contained in:
@@ -53,6 +53,9 @@ void ToolWindowManagerArea::addToolWindows(const QList<QWidget *> &toolWindows)
|
||||
int index = 0;
|
||||
foreach(QWidget* toolWindow, toolWindows) {
|
||||
index = addTab(toolWindow, toolWindow->windowIcon(), toolWindow->windowTitle());
|
||||
if(m_manager->toolWindowProperties(toolWindow) & ToolWindowManager::HideCloseButton) {
|
||||
tabBar()->tabButton(index, QTabBar::RightSide)->resize(0, 0);
|
||||
}
|
||||
}
|
||||
setCurrentIndex(index);
|
||||
m_manager->m_lastUsedArea = this;
|
||||
@@ -66,6 +69,18 @@ QList<QWidget *> ToolWindowManagerArea::toolWindows() {
|
||||
return result;
|
||||
}
|
||||
|
||||
void ToolWindowManagerArea::updateToolWindow(QWidget* toolWindow) {
|
||||
int index = indexOf(toolWindow);
|
||||
if(index >= 0) {
|
||||
if(m_manager->toolWindowProperties(toolWindow) & ToolWindowManager::HideCloseButton) {
|
||||
tabBar()->tabButton(index, QTabBar::RightSide)->resize(0, 0);
|
||||
} else {
|
||||
tabBar()->tabButton(index, QTabBar::RightSide)->resize(16, 16);
|
||||
}
|
||||
tabBar()->setTabText(index, toolWindow->windowTitle());
|
||||
}
|
||||
}
|
||||
|
||||
void ToolWindowManagerArea::mousePressEvent(QMouseEvent *) {
|
||||
if (qApp->mouseButtons() == Qt::LeftButton) {
|
||||
m_dragCanStart = true;
|
||||
|
||||
Reference in New Issue
Block a user