Two shortcuts Fit to best (Ctrl+=) and Original zoom (Ctrl+0).

--HG--
branch : develop
This commit is contained in:
dismine 2014-10-24 18:05:41 +03:00
parent 2bd82fa340
commit ea0e733602
2 changed files with 19 additions and 4 deletions

View File

@ -928,17 +928,27 @@ void MainWindow::ToolBarTools()
QKeySequence::ZoomOut). For examle "+" is Qt::Key_Plus + Qt::KeypadModifier for keypad. QKeySequence::ZoomOut). For examle "+" is Qt::Key_Plus + Qt::KeypadModifier for keypad.
Also for me don't work Qt:CTRL and work Qt::ControlModifier.*/ Also for me don't work Qt:CTRL and work Qt::ControlModifier.*/
const QList<QKeySequence> zoomInShortcuts = QList<QKeySequence>() << QKeySequence::ZoomIn QList<QKeySequence> zoomInShortcuts;
<< Qt::ControlModifier + Qt::Key_Plus + Qt::KeypadModifier; zoomInShortcuts.append(QKeySequence(QKeySequence::ZoomIn));
zoomInShortcuts.append(QKeySequence(Qt::ControlModifier + Qt::Key_Plus + Qt::KeypadModifier));
ui->actionZoomIn->setShortcuts(zoomInShortcuts); ui->actionZoomIn->setShortcuts(zoomInShortcuts);
connect(ui->actionZoomIn, &QAction::triggered, ui->view, &VMainGraphicsView::ZoomIn); connect(ui->actionZoomIn, &QAction::triggered, ui->view, &VMainGraphicsView::ZoomIn);
const QList<QKeySequence> zoomOutShortcuts = QList<QKeySequence>() << QKeySequence::ZoomOut QList<QKeySequence> zoomOutShortcuts;
<< Qt::ControlModifier + Qt::Key_Minus + Qt::KeypadModifier; zoomOutShortcuts.append(QKeySequence(QKeySequence::ZoomOut));
zoomOutShortcuts.append(QKeySequence(Qt::ControlModifier + Qt::Key_Minus + Qt::KeypadModifier));
ui->actionZoomOut->setShortcuts(zoomOutShortcuts); ui->actionZoomOut->setShortcuts(zoomOutShortcuts);
connect(ui->actionZoomOut, &QAction::triggered, ui->view, &VMainGraphicsView::ZoomOut); connect(ui->actionZoomOut, &QAction::triggered, ui->view, &VMainGraphicsView::ZoomOut);
QList<QKeySequence> zoomOriginalShortcuts;
zoomOriginalShortcuts.append(QKeySequence(Qt::ControlModifier + Qt::Key_0));
zoomOriginalShortcuts.append(QKeySequence(Qt::ControlModifier + Qt::Key_0 + Qt::KeypadModifier));
ui->actionZoomOriginal->setShortcuts(zoomOriginalShortcuts);
connect(ui->actionZoomOriginal, &QAction::triggered, ui->view, &VMainGraphicsView::ZoomOriginal); connect(ui->actionZoomOriginal, &QAction::triggered, ui->view, &VMainGraphicsView::ZoomOriginal);
QList<QKeySequence> zoomFitBestShortcuts;
zoomFitBestShortcuts.append(QKeySequence(Qt::ControlModifier + Qt::Key_Equal));
ui->actionZoomFitBest->setShortcuts(zoomFitBestShortcuts);
connect(ui->actionZoomFitBest, &QAction::triggered, ui->view, &VMainGraphicsView::ZoomFitBest); connect(ui->actionZoomFitBest, &QAction::triggered, ui->view, &VMainGraphicsView::ZoomFitBest);
} }

View File

@ -791,6 +791,8 @@
<addaction name="actionHistory"/> <addaction name="actionHistory"/>
<addaction name="actionZoomIn"/> <addaction name="actionZoomIn"/>
<addaction name="actionZoomOut"/> <addaction name="actionZoomOut"/>
<addaction name="actionZoomFitBest"/>
<addaction name="actionZoomOriginal"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="actionPattern_properties"/> <addaction name="actionPattern_properties"/>
<addaction name="actionEdit_pattern_code"/> <addaction name="actionEdit_pattern_code"/>
@ -1211,6 +1213,9 @@
<property name="text"> <property name="text">
<string>Zoom fit best</string> <string>Zoom fit best</string>
</property> </property>
<property name="shortcut">
<string>Ctrl+=</string>
</property>
</action> </action>
</widget> </widget>
<layoutdefault spacing="6" margin="11"/> <layoutdefault spacing="6" margin="11"/>