X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_MenuGroupPanel.cpp;h=8d5d24b2146206e706922eff835521861c478797;hb=037c2e978c242407cc2e4357a84c3ffead3e877d;hp=4f447117c97e1c6021f99d2aee9ba0a5777762e3;hpb=cf6ecce56482c1e15c6381d76b553004f87d3dd3;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_MenuGroupPanel.cpp b/src/XGUI/XGUI_MenuGroupPanel.cpp index 4f447117c..8d5d24b21 100644 --- a/src/XGUI/XGUI_MenuGroupPanel.cpp +++ b/src/XGUI/XGUI_MenuGroupPanel.cpp @@ -7,6 +7,7 @@ #include #include +#include XGUI_MenuGroupPanel::XGUI_MenuGroupPanel(QWidget *parent) : QWidget(parent), myNewRow(0), myNewCol(0), myMaxRow(1) @@ -31,7 +32,8 @@ void XGUI_MenuGroupPanel::placeWidget(QWidget* theWgt) myNewRow = 0; myNewCol++; } - myLayout->addWidget(theWgt, myNewRow, myNewCol, Qt::AlignLeft); + myLayout->addWidget(theWgt, myNewRow, myNewCol); + myLayout->setRowStretch(myNewRow, 0); myNewRow++; } @@ -57,13 +59,14 @@ void XGUI_MenuGroupPanel::resizeEvent(QResizeEvent* theEvent) foreach(QWidget* eachWidget, myActionWidget) { placeWidget(eachWidget); } + myLayout->setRowStretch(myMaxRow + 1, 1); } XGUI_Command* XGUI_MenuGroupPanel::addFeature(const QString& theId, const QString& theTitle, const QString& theTip, const QIcon& theIcon, - const QKeySequence& theKeys) + const QKeySequence& theKeys, bool isCheckable) { - XGUI_Command* aCommand = new XGUI_Command(theId, theIcon, theTitle, this); + XGUI_Command* aCommand = new XGUI_Command(theId, theIcon, theTitle, this, isCheckable); aCommand->setToolTip(theTip); if (!theKeys.isEmpty()) aCommand->setShortcut(theKeys); @@ -71,3 +74,13 @@ XGUI_Command* XGUI_MenuGroupPanel::addFeature(const QString& theId, const QStrin addCommand(aCommand); return aCommand; } + + +XGUI_Command* XGUI_MenuGroupPanel::feature(const QString& theId) const +{ + foreach (XGUI_Command* aCmd, myActions) { + if (aCmd->data().toString() == theId) + return aCmd; + } + return 0; +}