Commit 9fe7417f authored by Eugene Popov's avatar Eugene Popov
Browse files

Restore the ability to quickly switch between "Zoom to Fit" and "Actual Size"...

Restore the ability to quickly switch between "Zoom to Fit" and "Actual Size" with a keyboard shortcut

This MR restore the ability to quickly switch between "Zoom to Fit" and "Actual Size" (as well as between "Zoom to Fill" and "Actual Size") with a keyboard shortcut that was lost after one of the improvements.

BUG: 441152
parent 161dd42c
......@@ -152,6 +152,9 @@ public Q_SLOTS:
void setZoomToFill(bool);
void toggleZoomToFill();
void zoomActualSize();
void toggleBirdEyeView();
void setBackgroundColorMode(BackgroundColorWidget::ColorMode colorMode);
......@@ -223,8 +226,6 @@ private Q_SLOTS:
void slotCompleted();
void slotLoadingFailed();
void zoomActualSize();
void zoomIn(QPointF center = QPointF(-1, -1));
void zoomOut(QPointF center = QPointF(-1, -1));
......
......@@ -216,13 +216,9 @@ void DocumentViewController::setView(DocumentView* view)
connect(d->mView, &DocumentView::zoomToFillChanged, this, &DocumentViewController::updateZoomToFillActionFromView);
connect(d->mView, &DocumentView::currentToolChanged, this, &DocumentViewController::updateTool);
connect(d->mZoomToFitAction, &QAction::toggled, d->mView, &DocumentView::setZoomToFit);
connect(d->mZoomToFillAction, &QAction::toggled, d->mView, &DocumentView::setZoomToFill);
connect(d->mActualSizeAction, &QAction::toggled, d->mView, [this](bool checked){
if (checked) {
d->mView->setZoom(1.0);
}
});
connect(d->mZoomToFitAction, &QAction::triggered, d->mView, &DocumentView::toggleZoomToFit);
connect(d->mZoomToFillAction, &QAction::triggered, d->mView, &DocumentView::toggleZoomToFill);
connect(d->mActualSizeAction, &QAction::triggered, d->mView, &DocumentView::zoomActualSize);
connect(d->mZoomInAction, SIGNAL(triggered()),
d->mView, SLOT(zoomIn()));
connect(d->mZoomOutAction, SIGNAL(triggered()),
......
......@@ -303,9 +303,7 @@ void ZoomComboBox::changeZoomTo(int index) {
QVariant itemData = this->itemData(index);
QAction *action = itemData.value<QAction*>();
if (action) {
if (action->isCheckable()) {
action->setChecked(true);
} else {
if (!action->isCheckable() || !action->isChecked()) {
action->trigger();
}
} else if (itemData.canConvert(QMetaType::QReal)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment