refs #335, nested menu for dockwidgetinfoarea,

parent info areas can be accessed
This commit is contained in:
Klaus Basan
2014-10-16 16:43:13 +02:00
committed by Roland Winklmeier
parent 6e332683b1
commit fc4fb23b91

View File

@@ -68,10 +68,26 @@ namespace BlackGui
// Dockable widget's context menu
CDockWidget::addToContextMenu(contextMenu);
if (!contextMenu->isEmpty()) { contextMenu->addSeparator(); }
// from main component (info area)
// first info area, myself's direct parent info area
parentInfoAreas.first()->addToContextMenu(contextMenu);
// top info areas other than direct parent
// (parent's parent when nested info areas are used)
if (parentInfoAreas.size() < 2) { return; }
contextMenu->addSeparator();
parentInfoAreas.last()->addToContextMenu(contextMenu);
for (int i = 1; i < parentInfoAreas.size(); i++)
{
const CInfoArea *infoArea = parentInfoAreas.at(i);
QString title(infoArea->windowTitle());
if (title.isEmpty())
{
title = infoArea->objectName();
}
QMenu *m = contextMenu->addMenu(title);
infoArea->addToContextMenu(m);
}
}
void CDockWidgetInfoArea::initalFloating()