X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_Tools.cpp;h=8df14bdc35b74bfb93fce4cdb053f9ac5c302114;hb=d058dc531b24c5c548fabfc0dbede4506b4e3076;hp=87f636360229b6e5d2d68ee3fa910042cb5d957d;hpb=3ce4e2cad0e6802282a5a1d10c49c041e8a9f287;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_Tools.cpp b/src/ModuleBase/ModuleBase_Tools.cpp index 87f636360..8df14bdc3 100644 --- a/src/ModuleBase/ModuleBase_Tools.cpp +++ b/src/ModuleBase/ModuleBase_Tools.cpp @@ -7,10 +7,40 @@ #include #include -namespace ModuleBase_Tools -{ +namespace ModuleBase_Tools { //****************************************************************** //****************************************************************** + +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) +{ + if(!theLayout) + return; + theLayout->setContentsMargins(0, 0, 0, 0); + theLayout->setSpacing(5); +} + }