X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_Command.cpp;h=b289f8014ec6b65c6efe2084978bebd0fe0a6068;hb=f8d51abf2ab6024a974d42c139f7650ccf0ef774;hp=220e04f474b5007c1b2dabd60722aeca78c5ac1d;hpb=00e166f80c6501ef008ea4c9a1fd57b8c69f0202;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_Command.cpp b/src/XGUI/XGUI_Command.cpp index 220e04f47..b289f8014 100644 --- a/src/XGUI/XGUI_Command.cpp +++ b/src/XGUI/XGUI_Command.cpp @@ -1,6 +1,6 @@ #include "XGUI_Command.h" -#include +#include XGUI_Command::XGUI_Command(const QString& theId, QObject * parent, bool isCheckable) : QWidgetAction(parent), myCheckable(isCheckable) @@ -24,10 +24,16 @@ XGUI_Command::~XGUI_Command() QWidget* XGUI_Command::createWidget(QWidget* theParent) { if (theParent->inherits("XGUI_MenuGroupPanel")) { - QPushButton* aButton = new QPushButton(theParent); + QToolButton* aButton = new QToolButton(theParent); aButton->setIcon(icon()); aButton->setText(text()); - aButton->setStyleSheet("text-align: left"); + aButton->setStyleSheet("QToolButton::menu-indicator { image: none; }"); + aButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + aButton->setAutoRaise(true); + aButton->setArrowType(Qt::NoArrow); + aButton->setCheckable(myCheckable); + aButton->setMinimumSize(MIN_BUTTON_WIDTH, MIN_BUTTON_HEIGHT); + aButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); QKeySequence aKeys = shortcut(); QString aToolTip = toolTip(); if (!aKeys.isEmpty()) @@ -38,10 +44,8 @@ QWidget* XGUI_Command::createWidget(QWidget* theParent) aButton->addAction(this); connect(aButton, SIGNAL(clicked()), this, SLOT(trigger())); connect(this, SIGNAL(toggled(bool)), aButton, SLOT(setChecked(bool))); - aButton->setFlat(true); - aButton->setCheckable(myCheckable); + connect(this, SIGNAL(toggled(bool)), aButton, SLOT(setChecked(bool))); this->setCheckable(myCheckable); - aButton->setMinimumSize(MIN_BUTTON_WIDTH, MIN_BUTTON_HEIGHT); return aButton; } @@ -53,12 +57,12 @@ void XGUI_Command::connectTo(const QObject* theResiver, const char* theSlot) connect(this, SIGNAL(triggered(bool)), theResiver, theSlot); } -const QStringList& XGUI_Command::unblockableCommands() const +const QStringList& XGUI_Command::nestedCommands() const { - return myUnblockableCommands; + return myNestedCommands; } -void XGUI_Command::setUnblockableCommands(const QStringList& myUnblockableCommands) +void XGUI_Command::setNestedCommands(const QStringList& myUnblockableCommands) { - this->myUnblockableCommands = myUnblockableCommands; + this->myNestedCommands = myUnblockableCommands; }