X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_Tools.cpp;h=8df14bdc35b74bfb93fce4cdb053f9ac5c302114;hb=f40895b4d881810ef7d19c27ce6e952d72353d2c;hp=3f0069eca9640597f7c35a9033f82e48a6bc7d1d;hpb=141af0409801857d641e2bf61cd414b373e65b0b;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_Tools.cpp b/src/ModuleBase/ModuleBase_Tools.cpp index 3f0069eca..8df14bdc3 100644 --- a/src/ModuleBase/ModuleBase_Tools.cpp +++ b/src/ModuleBase/ModuleBase_Tools.cpp @@ -5,22 +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) { - ResultBodyPtr aBody = boost::dynamic_pointer_cast(theResult); - if (aBody) - return aBody->shape(); + if(!theLayout) + return; + theLayout->setContentsMargins(2, 5, 5, 2); + theLayout->setSpacing(4); +} - ResultConstructionPtr aConstruct = boost::dynamic_pointer_cast(theResult); - if (aConstruct) - return aConstruct->shape(); +void zeroMargins(QWidget* theWidget) +{ + if(!theWidget) + return; + zeroMargins(theWidget->layout()); +} - return boost::shared_ptr(); +void zeroMargins(QLayout* theLayout) +{ + if(!theLayout) + return; + theLayout->setContentsMargins(0, 0, 0, 0); + theLayout->setSpacing(5); } -} \ No newline at end of file +}