mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-21 22:04:13 +02:00
Folio-wide crosshair under the mouse (Display menu)
A new option in the Display menu, off by default and kept in the settings: two thin lines cross the whole folio, inside its border, through the grid point under the mouse, so that one sees at a glance whether symbols and terminals are in line, also while dragging them. They are drawn by the view in drawForeground(), on screen only: no item is added to the folio, so nothing of them is saved, exported or printed. Only the strips the lines leave and enter are repainted, and they go when the mouse leaves the view. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -590,6 +590,19 @@ void QETDiagramEditor::setUpActions()
|
||||
}
|
||||
});
|
||||
|
||||
//A crosshair across the whole folio under the mouse, to see
|
||||
//whether symbols and terminals are in line
|
||||
m_crosshair = new QAction(tr("Folio-wide crosshair"), this);
|
||||
ShortcutManager::instance().registerAction(m_crosshair, "diagrameditor.crosshair", tr("Diagram editors"), QKeySequence());
|
||||
m_crosshair->setStatusTip(tr("Show two lines across the whole folio under the mouse, to see whether parts are in line"));
|
||||
m_crosshair->setCheckable(true);
|
||||
m_crosshair->setChecked(DiagramView::crosshairShown());
|
||||
connect(m_crosshair, &QAction::triggered, [this](bool checked) {
|
||||
DiagramView::setCrosshairShown(checked);
|
||||
for (DiagramView *view : findChildren<DiagramView *>())
|
||||
view->viewport()->update();
|
||||
});
|
||||
|
||||
//Snap step for dragged texts, as a fraction of the folio grid
|
||||
m_text_grid_menu = new QMenu(tr("Text grid"), this);
|
||||
m_text_grid_menu->setIcon(QET::Icons::Grid);
|
||||
@@ -1703,6 +1716,7 @@ void QETDiagramEditor::setUpMenu()
|
||||
menu_affichage -> addAction(m_mode_visualise);
|
||||
menu_affichage -> addSeparator();
|
||||
menu_affichage -> addAction(m_draw_grid);
|
||||
menu_affichage -> addAction(m_crosshair);
|
||||
menu_affichage -> addMenu(m_text_grid_menu);
|
||||
menu_affichage -> addAction(m_draw_guides);
|
||||
menu_affichage -> addAction(m_cell_rulers);
|
||||
|
||||
Reference in New Issue
Block a user