forked from qt-creator/qt-creator
QmlDesigner: Move designer action to the center of the tool bar
Change-Id: I7d6b38ea31ebefe0c01acd9360271fc5ba062ffe Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
committed by
Tim Jenssen
parent
8a59bf19fe
commit
1549f5818c
@@ -1212,6 +1212,10 @@ void DesignerActionManager::addTransitionEffectAction(const TypeName &typeName)
|
|||||||
DesignerActionToolBar::DesignerActionToolBar(QWidget *parentWidget) : Utils::StyledBar(parentWidget),
|
DesignerActionToolBar::DesignerActionToolBar(QWidget *parentWidget) : Utils::StyledBar(parentWidget),
|
||||||
m_toolBar(new QToolBar("ActionToolBar", this))
|
m_toolBar(new QToolBar("ActionToolBar", this))
|
||||||
{
|
{
|
||||||
|
QWidget* empty = new QWidget();
|
||||||
|
empty->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred);
|
||||||
|
m_toolBar->addWidget(empty);
|
||||||
|
|
||||||
m_toolBar->setContentsMargins(0, 0, 0, 0);
|
m_toolBar->setContentsMargins(0, 0, 0, 0);
|
||||||
m_toolBar->setFloatable(true);
|
m_toolBar->setFloatable(true);
|
||||||
m_toolBar->setMovable(true);
|
m_toolBar->setMovable(true);
|
||||||
|
|||||||
@@ -212,6 +212,13 @@ void DesignModeWidget::disableWidgets()
|
|||||||
m_isDisabled = true;
|
m_isDisabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void addSpacerToToolBar(QToolBar *toolBar)
|
||||||
|
{
|
||||||
|
QWidget* empty = new QWidget();
|
||||||
|
empty->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred);
|
||||||
|
toolBar->addWidget(empty);
|
||||||
|
}
|
||||||
|
|
||||||
void DesignModeWidget::setup()
|
void DesignModeWidget::setup()
|
||||||
{
|
{
|
||||||
auto &actionManager = viewManager().designerActionManager();
|
auto &actionManager = viewManager().designerActionManager();
|
||||||
@@ -366,6 +373,7 @@ void DesignModeWidget::setup()
|
|||||||
|
|
||||||
// Create toolbars
|
// Create toolbars
|
||||||
auto toolBar = new QToolBar();
|
auto toolBar = new QToolBar();
|
||||||
|
|
||||||
toolBar->addAction(viewManager().componentViewAction());
|
toolBar->addAction(viewManager().componentViewAction());
|
||||||
toolBar->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
|
toolBar->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
|
||||||
DesignerActionToolBar *designerToolBar = QmlDesignerPlugin::instance()->viewManager().designerActionManager().createToolBar(m_toolBar);
|
DesignerActionToolBar *designerToolBar = QmlDesignerPlugin::instance()->viewManager().designerActionManager().createToolBar(m_toolBar);
|
||||||
@@ -407,6 +415,8 @@ void DesignModeWidget::setup()
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
addSpacerToToolBar(toolBar);
|
||||||
|
|
||||||
auto workspaceComboBox = new QComboBox();
|
auto workspaceComboBox = new QComboBox();
|
||||||
workspaceComboBox->setMinimumWidth(120);
|
workspaceComboBox->setMinimumWidth(120);
|
||||||
workspaceComboBox->setToolTip(tr("Switch the active workspace."));
|
workspaceComboBox->setToolTip(tr("Switch the active workspace."));
|
||||||
|
|||||||
Reference in New Issue
Block a user