+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
/*
* ModuleBase_WidgetToolbox.cpp
*
#include <QVBoxLayout>
#include <QIcon>
-ModuleBase_WidgetToolbox::ModuleBase_WidgetToolbox(QWidget* theParent, const Config_WidgetAPI* theData)
+ModuleBase_WidgetToolbox::ModuleBase_WidgetToolbox(QWidget* theParent,
+ const Config_WidgetAPI* theData)
: ModuleBase_PagedContainer(theParent, theData)
{
QVBoxLayout* aMainLayout = new QVBoxLayout(this);
ModuleBase_Tools::zeroMargins(aMainLayout);
- myToolBox = new ModuleBase_ToolBox(this);
+
+ bool aHasContainerParent = false;
+ QWidget* aParent = dynamic_cast<QWidget*>(parent());
+ while(aParent && !aHasContainerParent) {
+ ModuleBase_PagedContainer* aPagedContainer = dynamic_cast<ModuleBase_PagedContainer*>(aParent);
+ aHasContainerParent = aPagedContainer;
+ aParent = dynamic_cast<QWidget*>(aParent->parent());
+ }
+ myToolBox = new ModuleBase_ToolBox(this, aHasContainerParent);
// Dark-grey rounded tabs with button-like border #and bold font
// TODO: apply style to custom widget
QString css = "QToolBox::tab{background-color:#c8c8c8;"
{
ModuleBase_PagedContainer::addPage(thePage, theName, theCaseId, theIcon);
QFrame* aFrame = dynamic_cast<QFrame*>(thePage);
- aFrame->setFrameShape(QFrame::Box);
- aFrame->setFrameStyle(QFrame::Sunken);
myToolBox->addItem(aFrame, theName, theIcon );
return myToolBox->count();
}