X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FModuleBase%2FModuleBase_WidgetToolbox.cpp;h=48a44df867b792aba95718d1e9d19ae67265bea1;hb=5982960d3b8b17e5ab2f795e49f9daa00383e49c;hp=829afea9e292398b7b0c54bd98ce9a4301187d15;hpb=41695176c748943485f8844fea6e89cef9a0b6f5;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetToolbox.cpp b/src/ModuleBase/ModuleBase_WidgetToolbox.cpp index 829afea9e..48a44df86 100644 --- a/src/ModuleBase/ModuleBase_WidgetToolbox.cpp +++ b/src/ModuleBase/ModuleBase_WidgetToolbox.cpp @@ -18,13 +18,20 @@ #include #include -ModuleBase_WidgetToolbox::ModuleBase_WidgetToolbox(QWidget* theParent, const Config_WidgetAPI* theData, - const std::string& theParentId) -: ModuleBase_PagedContainer(theParent, theData, theParentId) +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(parent()); + while(aParent && !aHasContainerParent) { + ModuleBase_PagedContainer* aPagedContainer = dynamic_cast(aParent); + aHasContainerParent = aPagedContainer; + aParent = dynamic_cast(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;" @@ -46,12 +53,10 @@ ModuleBase_WidgetToolbox::~ModuleBase_WidgetToolbox() int ModuleBase_WidgetToolbox::addPage(ModuleBase_PageBase* thePage, const QString& theName, const QString& theCaseId, - const QIcon& theIcon ) + const QPixmap& theIcon ) { ModuleBase_PagedContainer::addPage(thePage, theName, theCaseId, theIcon); QFrame* aFrame = dynamic_cast(thePage); - aFrame->setFrameShape(QFrame::Box); - aFrame->setFrameStyle(QFrame::Sunken); myToolBox->addItem(aFrame, theName, theIcon ); return myToolBox->count(); }