forked from qt-creator/qt-creator
QmlDesigner: Add missing tooltips
Task-number: QDS-15077 Change-Id: I9ef9d8fbb13cdab5010913bc83c64762cf11645d Reviewed-by: Pranta Ghosh Dastider <pranta.dastider@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||||
|
|
||||||
#include "timelinetoolbar.h"
|
#include "timelinetoolbar.h"
|
||||||
|
#include <qmldesignertr.h>
|
||||||
|
|
||||||
#include "timelineconstants.h"
|
#include "timelineconstants.h"
|
||||||
#include "timelinegraphicsscene.h"
|
#include "timelinegraphicsscene.h"
|
||||||
@@ -132,7 +133,7 @@ QString TimelineToolBar::currentTimelineId() const
|
|||||||
void TimelineToolBar::setCurrentState(const QString &name)
|
void TimelineToolBar::setCurrentState(const QString &name)
|
||||||
{
|
{
|
||||||
if (name.isEmpty())
|
if (name.isEmpty())
|
||||||
m_stateLabel->setText(tr("Base State"));
|
m_stateLabel->setText(Tr::tr("Base State"));
|
||||||
else
|
else
|
||||||
m_stateLabel->setText(name);
|
m_stateLabel->setText(name);
|
||||||
}
|
}
|
||||||
@@ -191,9 +192,9 @@ void TimelineToolBar::setIsMcu(bool isMcu)
|
|||||||
{
|
{
|
||||||
m_curvePicker->setDisabled(isMcu);
|
m_curvePicker->setDisabled(isMcu);
|
||||||
if (isMcu)
|
if (isMcu)
|
||||||
m_curvePicker->setText(tr("Not Supported for MCUs"));
|
m_curvePicker->setText(Tr::tr("Not Supported for MCUs"));
|
||||||
else
|
else
|
||||||
m_curvePicker->setText(tr(m_curveEditorName));
|
m_curvePicker->setText(Tr::tr(m_curveEditorName));
|
||||||
}
|
}
|
||||||
|
|
||||||
void TimelineToolBar::setActionEnabled(const QString &name, bool enabled)
|
void TimelineToolBar::setActionEnabled(const QString &name, bool enabled)
|
||||||
@@ -232,7 +233,7 @@ void TimelineToolBar::createLeftControls()
|
|||||||
|
|
||||||
auto *settingsAction = createAction(TimelineConstants::C_SETTINGS,
|
auto *settingsAction = createAction(TimelineConstants::C_SETTINGS,
|
||||||
Theme::iconFromName(Theme::Icon::settings_medium),
|
Theme::iconFromName(Theme::Icon::settings_medium),
|
||||||
tr("Timeline Settings"),
|
Tr::tr("Timeline Settings"),
|
||||||
QKeySequence(Qt::Key_S));
|
QKeySequence(Qt::Key_S));
|
||||||
|
|
||||||
connect(settingsAction, &QAction::triggered, this, &TimelineToolBar::settingDialogClicked);
|
connect(settingsAction, &QAction::triggered, this, &TimelineToolBar::settingDialogClicked);
|
||||||
@@ -267,7 +268,7 @@ void TimelineToolBar::createCenterControls()
|
|||||||
|
|
||||||
auto *toStart = createAction(TimelineConstants::C_TO_START,
|
auto *toStart = createAction(TimelineConstants::C_TO_START,
|
||||||
Theme::iconFromName(Theme::Icon::toStartFrame_medium),
|
Theme::iconFromName(Theme::Icon::toStartFrame_medium),
|
||||||
tr("To Start"),
|
Tr::tr("Start Frame"),
|
||||||
QKeySequence(Qt::Key_Home));
|
QKeySequence(Qt::Key_Home));
|
||||||
|
|
||||||
connect(toStart, &QAction::triggered, this, &TimelineToolBar::toFirstFrameTriggered);
|
connect(toStart, &QAction::triggered, this, &TimelineToolBar::toFirstFrameTriggered);
|
||||||
@@ -277,7 +278,7 @@ void TimelineToolBar::createCenterControls()
|
|||||||
|
|
||||||
auto *previous = createAction(TimelineConstants::C_PREVIOUS,
|
auto *previous = createAction(TimelineConstants::C_PREVIOUS,
|
||||||
Theme::iconFromName(Theme::Icon::toPrevFrame_medium),
|
Theme::iconFromName(Theme::Icon::toPrevFrame_medium),
|
||||||
tr("Previous"),
|
Tr::tr("Previous Frame"),
|
||||||
QKeySequence(Qt::Key_Comma));
|
QKeySequence(Qt::Key_Comma));
|
||||||
|
|
||||||
connect(previous, &QAction::triggered, this, &TimelineToolBar::previousFrameTriggered);
|
connect(previous, &QAction::triggered, this, &TimelineToolBar::previousFrameTriggered);
|
||||||
@@ -292,7 +293,7 @@ void TimelineToolBar::createCenterControls()
|
|||||||
|
|
||||||
m_playing = createAction(TimelineConstants::C_PLAY,
|
m_playing = createAction(TimelineConstants::C_PLAY,
|
||||||
playbackIcon,
|
playbackIcon,
|
||||||
tr("Play"),
|
Tr::tr("Play"),
|
||||||
QKeySequence(Qt::Key_Space));
|
QKeySequence(Qt::Key_Space));
|
||||||
m_playing->setCheckable(true);
|
m_playing->setCheckable(true);
|
||||||
connect(m_playing, &QAction::triggered, this, &TimelineToolBar::playTriggered);
|
connect(m_playing, &QAction::triggered, this, &TimelineToolBar::playTriggered);
|
||||||
@@ -302,7 +303,7 @@ void TimelineToolBar::createCenterControls()
|
|||||||
|
|
||||||
auto *next = createAction(TimelineConstants::C_NEXT,
|
auto *next = createAction(TimelineConstants::C_NEXT,
|
||||||
Theme::iconFromName(Theme::Icon::toNextFrame_medium),
|
Theme::iconFromName(Theme::Icon::toNextFrame_medium),
|
||||||
tr("Next"),
|
Tr::tr("Next Frame"),
|
||||||
QKeySequence(Qt::Key_Period));
|
QKeySequence(Qt::Key_Period));
|
||||||
|
|
||||||
connect(next, &QAction::triggered, this, &TimelineToolBar::nextFrameTriggered);
|
connect(next, &QAction::triggered, this, &TimelineToolBar::nextFrameTriggered);
|
||||||
@@ -312,7 +313,7 @@ void TimelineToolBar::createCenterControls()
|
|||||||
|
|
||||||
auto *toEnd = createAction(TimelineConstants::C_TO_END,
|
auto *toEnd = createAction(TimelineConstants::C_TO_END,
|
||||||
Theme::iconFromName(Theme::Icon::toEndFrame_medium),
|
Theme::iconFromName(Theme::Icon::toEndFrame_medium),
|
||||||
tr("To End"),
|
Tr::tr("End Frame"),
|
||||||
QKeySequence(Qt::Key_End));
|
QKeySequence(Qt::Key_End));
|
||||||
|
|
||||||
connect(toEnd, &QAction::triggered, this, &TimelineToolBar::toLastFrameTriggered);
|
connect(toEnd, &QAction::triggered, this, &TimelineToolBar::toLastFrameTriggered);
|
||||||
@@ -327,7 +328,7 @@ void TimelineToolBar::createCenterControls()
|
|||||||
// TODO: Toggles looping. Select shortcut for this QDS-4941
|
// TODO: Toggles looping. Select shortcut for this QDS-4941
|
||||||
auto *loopAnimation = createAction(TimelineConstants::C_LOOP_PLAYBACK,
|
auto *loopAnimation = createAction(TimelineConstants::C_LOOP_PLAYBACK,
|
||||||
Theme::iconFromName(Theme::Icon::loopPlayback_medium),
|
Theme::iconFromName(Theme::Icon::loopPlayback_medium),
|
||||||
tr("Loop Playback"),
|
Tr::tr("Loop Playback"),
|
||||||
Qt::ControlModifier | Qt::ShiftModifier | Qt::Key_Space);
|
Qt::ControlModifier | Qt::ShiftModifier | Qt::Key_Space);
|
||||||
|
|
||||||
loopAnimation->setCheckable(true);
|
loopAnimation->setCheckable(true);
|
||||||
@@ -340,7 +341,7 @@ void TimelineToolBar::createCenterControls()
|
|||||||
m_animationPlaybackSpeed = createToolBarLineEdit(this);
|
m_animationPlaybackSpeed = createToolBarLineEdit(this);
|
||||||
LineEditDoubleValidator *validator = new LineEditDoubleValidator(0.1, 100.0, 1, m_animationPlaybackSpeed);
|
LineEditDoubleValidator *validator = new LineEditDoubleValidator(0.1, 100.0, 1, m_animationPlaybackSpeed);
|
||||||
m_animationPlaybackSpeed->setValidator(validator);
|
m_animationPlaybackSpeed->setValidator(validator);
|
||||||
m_animationPlaybackSpeed->setToolTip(tr("Playback Speed"));
|
m_animationPlaybackSpeed->setToolTip(Tr::tr("Playback Speed"));
|
||||||
addWidget(m_animationPlaybackSpeed);
|
addWidget(m_animationPlaybackSpeed);
|
||||||
|
|
||||||
auto emitPlaybackSpeedChanged = [this, validator]() {
|
auto emitPlaybackSpeedChanged = [this, validator]() {
|
||||||
@@ -356,6 +357,7 @@ void TimelineToolBar::createCenterControls()
|
|||||||
addSeparator();
|
addSeparator();
|
||||||
|
|
||||||
m_currentFrame = createToolBarLineEdit(this);
|
m_currentFrame = createToolBarLineEdit(this);
|
||||||
|
m_currentFrame->setToolTip(Tr::tr("Timeline Current Frame"));
|
||||||
addWidget(m_currentFrame);
|
addWidget(m_currentFrame);
|
||||||
|
|
||||||
auto emitCurrentChanged = [this] { emit currentFrameChanged(m_currentFrame->text().toInt()); };
|
auto emitCurrentChanged = [this] { emit currentFrameChanged(m_currentFrame->text().toInt()); };
|
||||||
@@ -372,7 +374,7 @@ void TimelineToolBar::createCenterControls()
|
|||||||
|
|
||||||
m_recording = createAction(TimelineConstants::C_AUTO_KEYFRAME,
|
m_recording = createAction(TimelineConstants::C_AUTO_KEYFRAME,
|
||||||
autoKeyIcon,
|
autoKeyIcon,
|
||||||
tr("Auto Key"),
|
Tr::tr("Auto Key"),
|
||||||
QKeySequence(Qt::Key_K));
|
QKeySequence(Qt::Key_K));
|
||||||
|
|
||||||
m_recording->setCheckable(true);
|
m_recording->setCheckable(true);
|
||||||
@@ -388,7 +390,7 @@ void TimelineToolBar::createCenterControls()
|
|||||||
|
|
||||||
m_curvePicker = createAction(TimelineConstants::C_CURVE_PICKER,
|
m_curvePicker = createAction(TimelineConstants::C_CURVE_PICKER,
|
||||||
Theme::iconFromName(Theme::Icon::curveDesigner_medium),
|
Theme::iconFromName(Theme::Icon::curveDesigner_medium),
|
||||||
tr(m_curveEditorName),
|
Tr::tr(m_curveEditorName),
|
||||||
QKeySequence(Qt::Key_C));
|
QKeySequence(Qt::Key_C));
|
||||||
|
|
||||||
m_curvePicker->setObjectName("Easing Curve Editor");
|
m_curvePicker->setObjectName("Easing Curve Editor");
|
||||||
@@ -416,6 +418,7 @@ void TimelineToolBar::createRightControls()
|
|||||||
addSeparator();
|
addSeparator();
|
||||||
|
|
||||||
m_firstFrame = createToolBarLineEdit(this);
|
m_firstFrame = createToolBarLineEdit(this);
|
||||||
|
m_firstFrame->setToolTip(Tr::tr("Timeline First Frame"));
|
||||||
addWidget(m_firstFrame);
|
addWidget(m_firstFrame);
|
||||||
|
|
||||||
auto emitStartChanged = [this] { emit startFrameChanged(m_firstFrame->text().toInt()); };
|
auto emitStartChanged = [this] { emit startFrameChanged(m_firstFrame->text().toInt()); };
|
||||||
@@ -427,7 +430,7 @@ void TimelineToolBar::createRightControls()
|
|||||||
|
|
||||||
auto *zoomOut = createAction(TimelineConstants::C_ZOOM_OUT,
|
auto *zoomOut = createAction(TimelineConstants::C_ZOOM_OUT,
|
||||||
Theme::iconFromName(Theme::Icon::zoomOut_medium),
|
Theme::iconFromName(Theme::Icon::zoomOut_medium),
|
||||||
tr("Zoom Out"),
|
Tr::tr("Zoom Out"),
|
||||||
QKeySequence(QKeySequence::ZoomOut));
|
QKeySequence(QKeySequence::ZoomOut));
|
||||||
|
|
||||||
connect(zoomOut, &QAction::triggered, [this] {
|
connect(zoomOut, &QAction::triggered, [this] {
|
||||||
@@ -454,7 +457,7 @@ void TimelineToolBar::createRightControls()
|
|||||||
|
|
||||||
auto *zoomIn = createAction(TimelineConstants::C_ZOOM_IN,
|
auto *zoomIn = createAction(TimelineConstants::C_ZOOM_IN,
|
||||||
Theme::iconFromName(Theme::Icon::zoomIn_medium),
|
Theme::iconFromName(Theme::Icon::zoomIn_medium),
|
||||||
tr("Zoom In"),
|
Tr::tr("Zoom In"),
|
||||||
QKeySequence(QKeySequence::ZoomIn));
|
QKeySequence(QKeySequence::ZoomIn));
|
||||||
|
|
||||||
connect(zoomIn, &QAction::triggered, [this] {
|
connect(zoomIn, &QAction::triggered, [this] {
|
||||||
@@ -467,6 +470,7 @@ void TimelineToolBar::createRightControls()
|
|||||||
addSeparator();
|
addSeparator();
|
||||||
|
|
||||||
m_lastFrame = createToolBarLineEdit(this);
|
m_lastFrame = createToolBarLineEdit(this);
|
||||||
|
m_lastFrame->setToolTip(Tr::tr("Timeline Last Frame"));
|
||||||
addWidget(m_lastFrame);
|
addWidget(m_lastFrame);
|
||||||
|
|
||||||
auto emitEndChanged = [this] { emit endFrameChanged(m_lastFrame->text().toInt()); };
|
auto emitEndChanged = [this] { emit endFrameChanged(m_lastFrame->text().toInt()); };
|
||||||
|
Reference in New Issue
Block a user