diff options
author | Thomas Hartmann <thomas.hartmann@qt.io> | 2020-02-25 16:23:04 +0100 |
---|---|---|
committer | Thomas Hartmann <thomas.hartmann@qt.io> | 2020-02-25 16:54:27 +0000 |
commit | bc62269304a191bd15e90ae7b1b41c25e864212b (patch) | |
tree | f1e4dc8058c0e4cb668410f72b45d0d73c4dad8a /src/plugins/qmldesigner/components/componentcore | |
parent | ece83d8e49c54295d2d51933ec15e80090943aeb (diff) |
QmlDesigner: Fix ZoomAction
Task-number: QDS-1720
Change-Id: I310679df54536841e0a7c6591bd1d03280c5280c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Diffstat (limited to 'src/plugins/qmldesigner/components/componentcore')
-rw-r--r-- | src/plugins/qmldesigner/components/componentcore/zoomaction.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/qmldesigner/components/componentcore/zoomaction.cpp b/src/plugins/qmldesigner/components/componentcore/zoomaction.cpp index 6d724d12ef2..2f809712107 100644 --- a/src/plugins/qmldesigner/components/componentcore/zoomaction.cpp +++ b/src/plugins/qmldesigner/components/componentcore/zoomaction.cpp @@ -30,10 +30,12 @@ namespace QmlDesigner { +const int defaultZoomIndex = 11; + ZoomAction::ZoomAction(QObject *parent) : QWidgetAction(parent), m_zoomLevel(1.0), - m_currentComboBoxIndex(8) + m_currentComboBoxIndex(defaultZoomIndex) { } @@ -58,7 +60,7 @@ void ZoomAction::zoomOut() void ZoomAction::resetZoomLevel() { m_zoomLevel = 1.0; - m_currentComboBoxIndex = 8; + m_currentComboBoxIndex = defaultZoomIndex; emit reseted(); } @@ -72,6 +74,9 @@ QWidget *ZoomAction::createWidget(QWidget *parent) { auto comboBox = new QComboBox(parent); + /* + * When add zoom levels do not forget to update defaultZoomIndex + */ if (m_comboBoxModel.isNull()) { m_comboBoxModel = comboBox->model(); comboBox->addItem(QLatin1String("1 %"), 0.01); |