refs #299, dockable widgets improvements

* preferred size instead of a auto adjustment for floatable widgets
* hack for hiding the tabbar (it still cosnumes space)
This commit is contained in:
Klaus Basan
2014-08-04 02:24:20 +02:00
parent d3858a8b37
commit 3c12cd7b30
5 changed files with 112 additions and 35 deletions

View File

@@ -119,9 +119,15 @@ namespace BlackGui
}
this->setNullTitleBar();
this->setContentsMargins(this->m_marginsWhenFloating);
if (this->m_autoAdjustWhenFloating) {
this->adjustSize();
if (!this->m_wasAlreadyFloating)
{
// for the first time resize
if (!this->m_preferredSizeWhenFloating.isNull())
{
this->resize(this->m_preferredSizeWhenFloating);
}
}
this->m_wasAlreadyFloating = true;
}
else
{
@@ -143,6 +149,20 @@ namespace BlackGui
this->setTitleBarWidget(this->m_emptyTitleBar);
}
QList<QWidget *> CDockWidget::findEmbeddedRuntimeComponents() const
{
QList<QWidget *> widgets = this->findChildren<QWidget *>();
QList<QWidget *> widgetsWithRuntimeComponent;
foreach(QWidget * w, widgets)
{
if (dynamic_cast<Components::CRuntimeBasedComponent *>(w))
{
widgetsWithRuntimeComponent.append(w);
}
}
return widgetsWithRuntimeComponent;
}
void CDockWidget::ps_showContextMenu(const QPoint &pos)
{
QPoint globalPos = this->mapToGlobal(pos);