Skip to content

Commit

Permalink
Merge pull request #354 from silicon-heaven/disable-zoom-channel-to-s…
Browse files Browse the repository at this point in the history
…election-with-multichannel-selection

disable "zoom channel to selection" with multichannel selection
  • Loading branch information
fvacek authored Oct 3, 2023
2 parents d9899a8 + 2a924b7 commit 3060b2f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libshvvisu/src/timeline/graphwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -678,10 +678,15 @@ void GraphWidget::showGraphSelectionContextMenu(const QPoint &mouse_pos)
m_graph->zoomToSelection(false);
update();
});
menu.addAction(tr("Zoom channel to selection"), this, [this]() {
auto *act_zoom_channel = menu.addAction(tr("Zoom channel to selection"), this, [this]() {
m_graph->zoomToSelection(true);
update();
});
qsizetype sel_ch1 = m_graph->posToChannel(m_graph->selectionRect().topLeft());
qsizetype sel_ch2 = m_graph->posToChannel(m_graph->selectionRect().bottomRight());
if (sel_ch1 != sel_ch2 || sel_ch1 < 0) {
act_zoom_channel->setEnabled(false);
}
menu.addAction(tr("Show selection info"), this, [this]() {
auto sel_rect = m_graph->selectionRect();
auto ch1_ix = m_graph->posToChannel(sel_rect.bottomLeft());
Expand Down

0 comments on commit 3060b2f

Please sign in to comment.