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:
Thomas Hartmann
2023-01-31 15:07:06 +01:00
parent 4597317d2d
commit f3ef600979
9 changed files with 29 additions and 11 deletions

View File

@@ -176,6 +176,11 @@ QIcon Theme::iconFromName(Icon i, QColor c)
return Utils::StyleHelper::getIconFromIconFont(fontName, Theme::getIconUnicode(i), 32, 32, color);
}
int Theme::toolbarSize()
{
return 41;
}
QColor Theme::qmlDesignerBackgroundColorDarker() const
{
return getColor(QmlDesigner_BackgroundColorDarker);

View File

@@ -336,6 +336,8 @@ public:
static QIcon iconFromName(Theme::Icon i, QColor c = {});
static int toolbarSize();
Q_INVOKABLE QColor qmlDesignerBackgroundColorDarker() const;
Q_INVOKABLE QColor qmlDesignerBackgroundColorDarkAlternate() const;
Q_INVOKABLE QColor qmlDesignerTabLight() const;

View File

@@ -72,6 +72,7 @@ ConnectionViewWidget::ConnectionViewWidget(QWidget *parent) :
const QList<QToolButton*> buttons = createToolBarWidgets();
ui->toolBar->setFixedHeight(41);
for (auto toolButton : buttons)
ui->toolBar->addWidget(toolButton);

View File

@@ -39,6 +39,7 @@ CurveEditorToolBar::CurveEditorToolBar(CurveEditorModel *model, QWidget* parent)
{
setFloatable(false);
setFixedHeight(Theme::toolbarSize());
setContentsMargins(0, 0, 0, 0);
QAction *tangentLinearAction = addAction(Theme::iconFromName(Theme::linear_medium), "Linear");
@@ -111,6 +112,7 @@ CurveEditorToolBar::CurveEditorToolBar(CurveEditorModel *model, QWidget* parent)
addWidget(durationWidget);
auto *positionBox = new QHBoxLayout;
positionBox->setContentsMargins(0, 0, 0, 0);
positionBox->addWidget(new QLabel(tr("Current Frame")));
positionBox->addWidget(m_currentSpin);

View File

@@ -3,6 +3,8 @@
#include "toolbox.h"
#include <theme.h>
#include <QToolBar>
#include <QHBoxLayout>
#include <QVBoxLayout>
@@ -17,6 +19,7 @@ ToolBox::ToolBox(SeekerSlider *seeker, QWidget *parentWidget)
m_rightToolBar(new QToolBar(QLatin1String("RightSidebar"), this)),
m_seeker(seeker)
{
setProperty("panelwidget", false);
m_leftToolBar->setFloatable(true);
m_leftToolBar->setMovable(true);
m_leftToolBar->setOrientation(Qt::Horizontal);
@@ -25,15 +28,19 @@ ToolBox::ToolBox(SeekerSlider *seeker, QWidget *parentWidget)
horizontalLayout->setContentsMargins(0, 0, 0, 0);
horizontalLayout->setSpacing(0);
setFixedHeight(Theme::toolbarSize());
auto stretchToolbar = new QToolBar(this);
m_leftToolBar->setProperty("panelwidget", true);
m_leftToolBar->setProperty("panelwidget", 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->setFixedHeight(Theme::toolbarSize());
stretchToolbar->setProperty("panelwidget", true);
stretchToolbar->setProperty("panelwidget", false);
stretchToolbar->setProperty("panelwidget_singlerow", false);
stretchToolbar->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);

View File

@@ -147,7 +147,7 @@ QToolBar *NavigatorWidget::createToolBar()
const QList<QToolButton*> buttons = createToolBarWidgets();
auto toolBar = new QToolBar();
toolBar->setFixedHeight(41);
toolBar->setFixedHeight(Theme::toolbarSize());
for (auto toolButton : buttons)
toolBar->addWidget(toolButton);

View File

@@ -96,7 +96,7 @@ TimelineToolBar::TimelineToolBar(QWidget *parent)
, m_grp()
{
setContentsMargins(0, 0, 0, 0);
setFixedHeight(41);
setFixedHeight(Theme::toolbarSize());
createLeftControls();
createCenterControls();
createRightControls();

View File

@@ -94,7 +94,7 @@ void ToolBar::createStatusBar()
auto quickWidget = new QQuickWidget;
quickWidget->setFixedHeight(41);
quickWidget->setFixedHeight(Theme::toolbarSize());
quickWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
quickWidget->setMinimumWidth(200);
quickWidget->setResizeMode(QQuickWidget::SizeRootObjectToView);
@@ -113,7 +113,7 @@ void ToolBar::createStatusBar()
}
Core::ICore::statusBar()->addWidget(quickWidget);
Core::ICore::statusBar()->setFixedHeight(41);
Core::ICore::statusBar()->setFixedHeight(Theme::toolbarSize());
}
bool ToolBar::isVisible()

View File

@@ -83,6 +83,7 @@ TransitionEditorToolBar::TransitionEditorToolBar(QWidget *parent)
: QToolBar(parent)
, m_grp()
{
setFixedHeight(Theme::toolbarSize());
setContentsMargins(0, 0, 0, 0);
createLeftControls();
createCenterControls();
@@ -165,7 +166,7 @@ void TransitionEditorToolBar::createLeftControls()
addSpacingToGroup(5);
auto *settingsAction = createAction(TransitionEditorConstants::C_SETTINGS,
TimelineIcons::ANIMATION.icon(),
Theme::iconFromName(Theme::Icon::settings_medium),
tr("Transition Settings"),
QKeySequence(Qt::Key_S));
connect(settingsAction,
@@ -206,7 +207,7 @@ void TransitionEditorToolBar::createCenterControls()
addSpacing(10);
auto *curvePicker = createAction(TransitionEditorConstants::C_CURVE_PICKER,
TimelineIcons::CURVE_EDITOR.icon(),
Theme::iconFromName(Theme::Icon::curveDesigner_medium),
tr("Easing Curve Editor"),
QKeySequence(Qt::Key_C));
@@ -236,7 +237,7 @@ void TransitionEditorToolBar::createRightControls()
addSpacing(10);
auto *zoomOut = createAction(TransitionEditorConstants::C_ZOOM_OUT,
TimelineIcons::ZOOM_SMALL.icon(),
Theme::iconFromName(Theme::Icon::zoomOut_medium),
tr("Zoom Out"),
QKeySequence(QKeySequence::ZoomOut));
@@ -261,7 +262,7 @@ void TransitionEditorToolBar::createRightControls()
addSpacing(10);
auto *zoomIn = createAction(TransitionEditorConstants::C_ZOOM_IN,
TimelineIcons::ZOOM_BIG.icon(),
Theme::iconFromName(Theme::Icon::zoomIn_medium),
tr("Zoom In"),
QKeySequence(QKeySequence::ZoomIn));