5 #include "qui/ZoomWidget.hpp"
9 ZoomWidget::ZoomWidget(QWidget *parent)
13 zoom.setRange(0.01, max_zoom_size);
14 zoom.setSingleStep(0.1);
15 connect(&zoom, SIGNAL(valueChanged(double)), this, SLOT(setValue(double)));
17 auto_ptr<QLabel> zoomLabel(new QLabel());
18 zoomLabel->setPixmap(QIcon(":/icons/viewmag.png").pixmap(16, 16));
19 QHBoxLayout *layout = new QHBoxLayout;
20 layout->addWidget(zoomLabel.get());
21 layout->addWidget(&zoom);
22 layout->addWidget(new QLabel("bp/pix"));
25 setToolTip(tr("Zoom"));
26 setWhatsThis(tr("Zoom magnification factor (base pairs per pixel)"));
29 void ZoomWidget::setValue(double value)
31 if (cur_value != value)
34 zoom.setValue(cur_value);
35 emit valueChanged(cur_value);
39 void ZoomWidget::setRange(double min, double max)
41 zoom.setRange(min, max);
44 void ZoomWidget::setSingleStep(double val)
46 zoom.setSingleStep(val);
49 double ZoomWidget::singleStep() const
51 return zoom.singleStep();
54 double ZoomWidget::minimum() const
56 return zoom.minimum();
59 double ZoomWidget::maximum() const
61 return zoom.maximum();