X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_Tools.cpp;h=8df14bdc35b74bfb93fce4cdb053f9ac5c302114;hb=d058dc531b24c5c548fabfc0dbede4506b4e3076;hp=dfd282ea34fe5e90343f49154cf837cc6ca40f16;hpb=28dfabc017ae38edd699d80ff679cd65971136b8;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_Tools.cpp b/src/ModuleBase/ModuleBase_Tools.cpp index dfd282ea3..8df14bdc3 100644 --- a/src/ModuleBase/ModuleBase_Tools.cpp +++ b/src/ModuleBase/ModuleBase_Tools.cpp @@ -5,18 +5,42 @@ #include "ModuleBase_Tools.h" #include #include +#include -namespace ModuleBase_Tools -{ +namespace ModuleBase_Tools { + +//****************************************************************** //****************************************************************** -boost::shared_ptr shape(ResultPtr theResult) + +void adjustMargins(QWidget* theWidget) +{ + if(!theWidget) + return; + adjustMargins(theWidget->layout()); +} + +void adjustMargins(QLayout* theLayout) +{ + if(!theLayout) + return; + theLayout->setContentsMargins(2, 5, 5, 2); + theLayout->setSpacing(4); +} + +void zeroMargins(QWidget* theWidget) +{ + if(!theWidget) + return; + zeroMargins(theWidget->layout()); +} + +void zeroMargins(QLayout* theLayout) { - ResultBodyPtr aBody = boost::dynamic_pointer_cast(theResult); - if (aBody) return aBody->shape(); - ResultConstructionPtr aConstruct = boost::dynamic_pointer_cast(theResult); - if (aConstruct) return aConstruct->shape(); - return boost::shared_ptr(); + if(!theLayout) + return; + theLayout->setContentsMargins(0, 0, 0, 0); + theLayout->setSpacing(5); } }