Unify zooming actions of image viewer and model editor

Change-Id: I5761ab579beda5b2cd0b725869ed216cb97e900c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Eike Ziller
2018-01-31 12:41:04 +01:00
parent d110b2f4db
commit e1d2d35c20
8 changed files with 49 additions and 30 deletions

View File

@@ -637,6 +637,30 @@ void MainWindow::registerDefaultActions()
medit->addAction(cmd, Constants::G_EDIT_OTHER);
tmpaction->setEnabled(false);
// Zoom In Action
icon = QIcon::hasThemeIcon("zoom-in") ? QIcon::fromTheme("zoom-in")
: Utils::Icons::ZOOMIN_TOOLBAR.icon();
tmpaction = new QAction(icon, tr("Zoom In"), this);
cmd = ActionManager::registerAction(tmpaction, Constants::ZOOM_IN);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl++")));
tmpaction->setEnabled(false);
// Zoom Out Action
icon = QIcon::hasThemeIcon("zoom-out") ? QIcon::fromTheme("zoom-out")
: Utils::Icons::ZOOMOUT_TOOLBAR.icon();
tmpaction = new QAction(icon, tr("Zoom Out"), this);
cmd = ActionManager::registerAction(tmpaction, Constants::ZOOM_OUT);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+-")));
tmpaction->setEnabled(false);
// Zoom Reset Action
icon = QIcon::hasThemeIcon("zoom-original") ? QIcon::fromTheme("zoom-original")
: Utils::Icons::EYE_OPEN_TOOLBAR.icon();
tmpaction = new QAction(icon, tr("Original Size"), this);
cmd = ActionManager::registerAction(tmpaction, Constants::ZOOM_RESET);
cmd->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+0") : tr("Ctrl+0")));
tmpaction->setEnabled(false);
// Options Action
mtools->appendGroup(Constants::G_TOOLS_OPTIONS);
mtools->addSeparator(Constants::G_TOOLS_OPTIONS);