#include "XGUI_Command.h"
-#include <QPushButton>
+#include <QToolButton>
XGUI_Command::XGUI_Command(const QString& theId, QObject * parent, bool isCheckable)
: QWidgetAction(parent), myCheckable(isCheckable)
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())
connect(aButton, SIGNAL(clicked()), this, SLOT(trigger()));
connect(this, SIGNAL(toggled(bool)), aButton, SLOT(setChecked(bool)));
connect(this, SIGNAL(toggled(bool)), aButton, SLOT(setChecked(bool)));
- aButton->setFlat(true);
- aButton->setCheckable(myCheckable);
this->setCheckable(myCheckable);
- aButton->setMinimumSize(MIN_BUTTON_WIDTH, MIN_BUTTON_HEIGHT);
return aButton;
}
: QObject(parent), myDesktop(parent)
{
parent->setTabPosition(Qt::TopDockWidgetArea, QTabWidget::North);
+ myDesktop->setStyleSheet("QTabBar::tab {height: 24px;}");
myGeneralPage = addWorkbench(tr("General"));
myGeneralPage->parentWidget()->setMaximumWidth(200);
myGeneralPage->installEventFilter(this);
+// QString aStyle = myDesktop->styleSheet();
+// aStyle += " QTabBar::tab {min-height: 24px;}";
}
XGUI_MainMenu::~XGUI_MainMenu(void)
myNewRow = 0;
myNewCol++;
}
- myLayout->addWidget(theWgt, myNewRow, myNewCol, Qt::AlignLeft);
+ myLayout->addWidget(theWgt, myNewRow, myNewCol);
+ myLayout->setRowStretch(myNewRow, 0);
myNewRow++;
}
foreach(QWidget* eachWidget, myActionWidget) {
placeWidget(eachWidget);
}
+ myLayout->setRowStretch(myMaxRow + 1, 1);
}
XGUI_Command* XGUI_MenuGroupPanel::addFeature(const QString& theId, const QString& theTitle,
XGUI_MenuGroupPanel* aGroup = new XGUI_MenuGroupPanel(myChildWidget);
aGroup->setObjectName(theId);
myLayout->addWidget(aGroup);
- addSeparator();
+ if(theId != "Default") {
+ addSeparator();
+ }
myLayout->addStretch();
myGroups.append(aGroup);
return aGroup;
for (aIt = myGroups.constBegin(); aIt != myGroups.constEnd(); ++aIt)
aList.append((*aIt)->features());
return aList;
-}
\ No newline at end of file
+}