action_view_zoom_in_(new QAction(this)),
action_view_zoom_out_(new QAction(this)),
action_view_zoom_fit_(new QAction(this)),
- action_view_zoom_one_to_one_(new QAction(this)),
action_view_show_cursors_(new QAction(this)),
segment_display_mode_selector_(new QToolButton(this)),
action_sdm_last_(new QAction(this)),
connect(action_view_zoom_fit_, SIGNAL(triggered(bool)),
this, SLOT(on_actionViewZoomFit_triggered(bool)));
- action_view_zoom_one_to_one_->setText(tr("Zoom to O&ne-to-One"));
- action_view_zoom_one_to_one_->setIcon(QIcon::fromTheme("zoom-original",
- QIcon(":/icons/zoom-original.png")));
- action_view_zoom_one_to_one_->setShortcut(QKeySequence(Qt::Key_O));
- connect(action_view_zoom_one_to_one_, SIGNAL(triggered(bool)),
- this, SLOT(on_actionViewZoomOneToOne_triggered()));
-
action_view_show_cursors_->setCheckable(true);
action_view_show_cursors_->setIcon(QIcon(":/icons/show-cursors.svg"));
action_view_show_cursors_->setShortcut(QKeySequence(Qt::Key_C));
addAction(action_view_zoom_in_);
addAction(action_view_zoom_out_);
addAction(action_view_zoom_fit_);
- addAction(action_view_zoom_one_to_one_);
addSeparator();
addAction(action_view_show_cursors_);
multi_segment_actions_.push_back(addSeparator());
return action_view_zoom_fit_;
}
-QAction* StandardBar::action_view_zoom_one_to_one() const
-{
- return action_view_zoom_one_to_one_;
-}
-
QAction* StandardBar::action_view_show_cursors() const
{
return action_view_show_cursors_;
view_->zoom_fit(checked);
}
-void StandardBar::on_actionViewZoomOneToOne_triggered()
-{
- view_->zoom_one_to_one();
-}
-
void StandardBar::on_actionViewShowCursors_triggered()
{
const bool show = action_view_show_cursors_->isChecked();
QAction* action_view_zoom_in() const;
QAction* action_view_zoom_out() const;
QAction* action_view_zoom_fit() const;
- QAction* action_view_zoom_one_to_one() const;
QAction* action_view_show_cursors() const;
protected:
QAction *const action_view_zoom_in_;
QAction *const action_view_zoom_out_;
QAction *const action_view_zoom_fit_;
- QAction *const action_view_zoom_one_to_one_;
QAction *const action_view_show_cursors_;
QToolButton *segment_display_mode_selector_;
void on_actionViewZoomFit_triggered(bool checked);
- void on_actionViewZoomOneToOne_triggered();
-
void on_actionViewShowCursors_triggered();
void on_cursor_state_changed(bool show);
set_scale_offset(scale.convert_to<double>(), extents.first);
}
-void View::zoom_one_to_one()
-{
- using pv::data::SignalData;
-
- // Make a set of all the visible data objects
- set< shared_ptr<SignalData> > visible_data = get_visible_data();
- if (visible_data.empty())
- return;
-
- assert(viewport_);
- const int w = viewport_->width();
- if (w <= 0)
- return;
-
- set_zoom(1.0 / session_.get_samplerate(), w / 2);
-}
-
void View::set_scale_offset(double scale, const Timestamp& offset)
{
// Disable sticky scrolling / always zoom to fit when acquisition runs