X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FModuleBase%2FModuleBase_WidgetToolbox.cpp;h=16a00dabe7846bd4b58a6120f90f82e6d5a057c9;hb=d0add0e964478b0c8f08a577ffe3a8dc0a7fd60d;hp=83afaa5d62555adee1cf8dbb8798333a0bcb3737;hpb=0a04bcd634373c65391611ca0e818d432e71ada5;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetToolbox.cpp b/src/ModuleBase/ModuleBase_WidgetToolbox.cpp index 83afaa5d6..16a00dabe 100644 --- a/src/ModuleBase/ModuleBase_WidgetToolbox.cpp +++ b/src/ModuleBase/ModuleBase_WidgetToolbox.cpp @@ -1,3 +1,4 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D /* * ModuleBase_WidgetToolbox.cpp * @@ -18,13 +19,21 @@ #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;" @@ -50,8 +59,6 @@ int ModuleBase_WidgetToolbox::addPage(ModuleBase_PageBase* thePage, { 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(); }