forked from qt-creator/qt-creator
QmlDesigner: Properly define toolbar height everywhere
Adjusting some icons and details. Change-Id: Iedf79ebeac2dc73fccf48e85bd524461a2fd6807 Reviewed-by: Ali Kianian <ali.kianian@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -176,6 +176,11 @@ QIcon Theme::iconFromName(Icon i, QColor c)
|
|||||||
return Utils::StyleHelper::getIconFromIconFont(fontName, Theme::getIconUnicode(i), 32, 32, color);
|
return Utils::StyleHelper::getIconFromIconFont(fontName, Theme::getIconUnicode(i), 32, 32, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Theme::toolbarSize()
|
||||||
|
{
|
||||||
|
return 41;
|
||||||
|
}
|
||||||
|
|
||||||
QColor Theme::qmlDesignerBackgroundColorDarker() const
|
QColor Theme::qmlDesignerBackgroundColorDarker() const
|
||||||
{
|
{
|
||||||
return getColor(QmlDesigner_BackgroundColorDarker);
|
return getColor(QmlDesigner_BackgroundColorDarker);
|
||||||
|
|||||||
@@ -336,6 +336,8 @@ public:
|
|||||||
|
|
||||||
static QIcon iconFromName(Theme::Icon i, QColor c = {});
|
static QIcon iconFromName(Theme::Icon i, QColor c = {});
|
||||||
|
|
||||||
|
static int toolbarSize();
|
||||||
|
|
||||||
Q_INVOKABLE QColor qmlDesignerBackgroundColorDarker() const;
|
Q_INVOKABLE QColor qmlDesignerBackgroundColorDarker() const;
|
||||||
Q_INVOKABLE QColor qmlDesignerBackgroundColorDarkAlternate() const;
|
Q_INVOKABLE QColor qmlDesignerBackgroundColorDarkAlternate() const;
|
||||||
Q_INVOKABLE QColor qmlDesignerTabLight() const;
|
Q_INVOKABLE QColor qmlDesignerTabLight() const;
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ ConnectionViewWidget::ConnectionViewWidget(QWidget *parent) :
|
|||||||
|
|
||||||
const QList<QToolButton*> buttons = createToolBarWidgets();
|
const QList<QToolButton*> buttons = createToolBarWidgets();
|
||||||
|
|
||||||
|
ui->toolBar->setFixedHeight(41);
|
||||||
for (auto toolButton : buttons)
|
for (auto toolButton : buttons)
|
||||||
ui->toolBar->addWidget(toolButton);
|
ui->toolBar->addWidget(toolButton);
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ CurveEditorToolBar::CurveEditorToolBar(CurveEditorModel *model, QWidget* parent)
|
|||||||
|
|
||||||
{
|
{
|
||||||
setFloatable(false);
|
setFloatable(false);
|
||||||
|
setFixedHeight(Theme::toolbarSize());
|
||||||
setContentsMargins(0, 0, 0, 0);
|
setContentsMargins(0, 0, 0, 0);
|
||||||
|
|
||||||
QAction *tangentLinearAction = addAction(Theme::iconFromName(Theme::linear_medium), "Linear");
|
QAction *tangentLinearAction = addAction(Theme::iconFromName(Theme::linear_medium), "Linear");
|
||||||
@@ -111,6 +112,7 @@ CurveEditorToolBar::CurveEditorToolBar(CurveEditorModel *model, QWidget* parent)
|
|||||||
addWidget(durationWidget);
|
addWidget(durationWidget);
|
||||||
|
|
||||||
auto *positionBox = new QHBoxLayout;
|
auto *positionBox = new QHBoxLayout;
|
||||||
|
positionBox->setContentsMargins(0, 0, 0, 0);
|
||||||
positionBox->addWidget(new QLabel(tr("Current Frame")));
|
positionBox->addWidget(new QLabel(tr("Current Frame")));
|
||||||
positionBox->addWidget(m_currentSpin);
|
positionBox->addWidget(m_currentSpin);
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
#include "toolbox.h"
|
#include "toolbox.h"
|
||||||
|
|
||||||
|
#include <theme.h>
|
||||||
|
|
||||||
#include <QToolBar>
|
#include <QToolBar>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
@@ -17,6 +19,7 @@ ToolBox::ToolBox(SeekerSlider *seeker, QWidget *parentWidget)
|
|||||||
m_rightToolBar(new QToolBar(QLatin1String("RightSidebar"), this)),
|
m_rightToolBar(new QToolBar(QLatin1String("RightSidebar"), this)),
|
||||||
m_seeker(seeker)
|
m_seeker(seeker)
|
||||||
{
|
{
|
||||||
|
setProperty("panelwidget", false);
|
||||||
m_leftToolBar->setFloatable(true);
|
m_leftToolBar->setFloatable(true);
|
||||||
m_leftToolBar->setMovable(true);
|
m_leftToolBar->setMovable(true);
|
||||||
m_leftToolBar->setOrientation(Qt::Horizontal);
|
m_leftToolBar->setOrientation(Qt::Horizontal);
|
||||||
@@ -25,15 +28,19 @@ ToolBox::ToolBox(SeekerSlider *seeker, QWidget *parentWidget)
|
|||||||
horizontalLayout->setContentsMargins(0, 0, 0, 0);
|
horizontalLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
horizontalLayout->setSpacing(0);
|
horizontalLayout->setSpacing(0);
|
||||||
|
|
||||||
|
setFixedHeight(Theme::toolbarSize());
|
||||||
|
|
||||||
auto stretchToolbar = new QToolBar(this);
|
auto stretchToolbar = new QToolBar(this);
|
||||||
|
|
||||||
m_leftToolBar->setProperty("panelwidget", true);
|
m_leftToolBar->setProperty("panelwidget", false);
|
||||||
m_leftToolBar->setProperty("panelwidget_singlerow", false);
|
m_leftToolBar->setProperty("panelwidget_singlerow", false);
|
||||||
|
m_leftToolBar->setFixedHeight(Theme::toolbarSize());
|
||||||
|
|
||||||
m_rightToolBar->setProperty("panelwidget", true);
|
m_rightToolBar->setProperty("panelwidget", false);
|
||||||
m_rightToolBar->setProperty("panelwidget_singlerow", false);
|
m_rightToolBar->setProperty("panelwidget_singlerow", false);
|
||||||
|
m_rightToolBar->setFixedHeight(Theme::toolbarSize());
|
||||||
|
|
||||||
stretchToolbar->setProperty("panelwidget", true);
|
stretchToolbar->setProperty("panelwidget", false);
|
||||||
stretchToolbar->setProperty("panelwidget_singlerow", false);
|
stretchToolbar->setProperty("panelwidget_singlerow", false);
|
||||||
|
|
||||||
stretchToolbar->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
|
stretchToolbar->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ QToolBar *NavigatorWidget::createToolBar()
|
|||||||
const QList<QToolButton*> buttons = createToolBarWidgets();
|
const QList<QToolButton*> buttons = createToolBarWidgets();
|
||||||
|
|
||||||
auto toolBar = new QToolBar();
|
auto toolBar = new QToolBar();
|
||||||
toolBar->setFixedHeight(41);
|
toolBar->setFixedHeight(Theme::toolbarSize());
|
||||||
for (auto toolButton : buttons)
|
for (auto toolButton : buttons)
|
||||||
toolBar->addWidget(toolButton);
|
toolBar->addWidget(toolButton);
|
||||||
|
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ TimelineToolBar::TimelineToolBar(QWidget *parent)
|
|||||||
, m_grp()
|
, m_grp()
|
||||||
{
|
{
|
||||||
setContentsMargins(0, 0, 0, 0);
|
setContentsMargins(0, 0, 0, 0);
|
||||||
setFixedHeight(41);
|
setFixedHeight(Theme::toolbarSize());
|
||||||
createLeftControls();
|
createLeftControls();
|
||||||
createCenterControls();
|
createCenterControls();
|
||||||
createRightControls();
|
createRightControls();
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ void ToolBar::createStatusBar()
|
|||||||
|
|
||||||
auto quickWidget = new QQuickWidget;
|
auto quickWidget = new QQuickWidget;
|
||||||
|
|
||||||
quickWidget->setFixedHeight(41);
|
quickWidget->setFixedHeight(Theme::toolbarSize());
|
||||||
quickWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
quickWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
||||||
quickWidget->setMinimumWidth(200);
|
quickWidget->setMinimumWidth(200);
|
||||||
quickWidget->setResizeMode(QQuickWidget::SizeRootObjectToView);
|
quickWidget->setResizeMode(QQuickWidget::SizeRootObjectToView);
|
||||||
@@ -113,7 +113,7 @@ void ToolBar::createStatusBar()
|
|||||||
}
|
}
|
||||||
|
|
||||||
Core::ICore::statusBar()->addWidget(quickWidget);
|
Core::ICore::statusBar()->addWidget(quickWidget);
|
||||||
Core::ICore::statusBar()->setFixedHeight(41);
|
Core::ICore::statusBar()->setFixedHeight(Theme::toolbarSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ToolBar::isVisible()
|
bool ToolBar::isVisible()
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ TransitionEditorToolBar::TransitionEditorToolBar(QWidget *parent)
|
|||||||
: QToolBar(parent)
|
: QToolBar(parent)
|
||||||
, m_grp()
|
, m_grp()
|
||||||
{
|
{
|
||||||
|
setFixedHeight(Theme::toolbarSize());
|
||||||
setContentsMargins(0, 0, 0, 0);
|
setContentsMargins(0, 0, 0, 0);
|
||||||
createLeftControls();
|
createLeftControls();
|
||||||
createCenterControls();
|
createCenterControls();
|
||||||
@@ -165,7 +166,7 @@ void TransitionEditorToolBar::createLeftControls()
|
|||||||
addSpacingToGroup(5);
|
addSpacingToGroup(5);
|
||||||
|
|
||||||
auto *settingsAction = createAction(TransitionEditorConstants::C_SETTINGS,
|
auto *settingsAction = createAction(TransitionEditorConstants::C_SETTINGS,
|
||||||
TimelineIcons::ANIMATION.icon(),
|
Theme::iconFromName(Theme::Icon::settings_medium),
|
||||||
tr("Transition Settings"),
|
tr("Transition Settings"),
|
||||||
QKeySequence(Qt::Key_S));
|
QKeySequence(Qt::Key_S));
|
||||||
connect(settingsAction,
|
connect(settingsAction,
|
||||||
@@ -206,7 +207,7 @@ void TransitionEditorToolBar::createCenterControls()
|
|||||||
addSpacing(10);
|
addSpacing(10);
|
||||||
|
|
||||||
auto *curvePicker = createAction(TransitionEditorConstants::C_CURVE_PICKER,
|
auto *curvePicker = createAction(TransitionEditorConstants::C_CURVE_PICKER,
|
||||||
TimelineIcons::CURVE_EDITOR.icon(),
|
Theme::iconFromName(Theme::Icon::curveDesigner_medium),
|
||||||
tr("Easing Curve Editor"),
|
tr("Easing Curve Editor"),
|
||||||
QKeySequence(Qt::Key_C));
|
QKeySequence(Qt::Key_C));
|
||||||
|
|
||||||
@@ -236,7 +237,7 @@ void TransitionEditorToolBar::createRightControls()
|
|||||||
addSpacing(10);
|
addSpacing(10);
|
||||||
|
|
||||||
auto *zoomOut = createAction(TransitionEditorConstants::C_ZOOM_OUT,
|
auto *zoomOut = createAction(TransitionEditorConstants::C_ZOOM_OUT,
|
||||||
TimelineIcons::ZOOM_SMALL.icon(),
|
Theme::iconFromName(Theme::Icon::zoomOut_medium),
|
||||||
tr("Zoom Out"),
|
tr("Zoom Out"),
|
||||||
QKeySequence(QKeySequence::ZoomOut));
|
QKeySequence(QKeySequence::ZoomOut));
|
||||||
|
|
||||||
@@ -261,7 +262,7 @@ void TransitionEditorToolBar::createRightControls()
|
|||||||
addSpacing(10);
|
addSpacing(10);
|
||||||
|
|
||||||
auto *zoomIn = createAction(TransitionEditorConstants::C_ZOOM_IN,
|
auto *zoomIn = createAction(TransitionEditorConstants::C_ZOOM_IN,
|
||||||
TimelineIcons::ZOOM_BIG.icon(),
|
Theme::iconFromName(Theme::Icon::zoomIn_medium),
|
||||||
tr("Zoom In"),
|
tr("Zoom In"),
|
||||||
QKeySequence(QKeySequence::ZoomIn));
|
QKeySequence(QKeySequence::ZoomIn));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user