X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_Tools.cpp;h=8df14bdc35b74bfb93fce4cdb053f9ac5c302114;hb=7981678231adaa3ef7468d7564fef427cffdaf50;hp=f68de8da5cba818502ee05c88496a59d239488e9;hpb=8dc74f82810d5f597b78633b457efb0ef4f89f9f;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_Tools.cpp b/src/ModuleBase/ModuleBase_Tools.cpp index f68de8da5..8df14bdc3 100644 --- a/src/ModuleBase/ModuleBase_Tools.cpp +++ b/src/ModuleBase/ModuleBase_Tools.cpp @@ -12,4 +12,35 @@ 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); +} + }