5 #include "qui/ZoomWidget.hpp"
9 ZoomWidget::ZoomWidget(QWidget *parent)
14 zoom = new QDoubleSpinBox(this);
15 zoom->setRange(0.01, max_zoom_size);
16 zoom->setSingleStep(0.1);
17 connect(zoom, SIGNAL(valueChanged(double)), this, SLOT(setValue(double)));
19 QLabel *zoomLabel = new QLabel();
20 zoomLabel->setPixmap(QIcon(":/icons/viewmag.png").pixmap(16, 16));
21 QHBoxLayout *layout = new QHBoxLayout;
22 layout->addWidget(zoomLabel);
23 layout->addWidget(zoom);
24 layout->addWidget(new QLabel("bp/pix", this));
27 setToolTip(tr("Zoom"));
28 setWhatsThis(tr("Zoom magnification factor (base pairs per pixel)"));
31 void ZoomWidget::setValue(double value)
33 if (cur_value != value)
36 zoom->setValue(cur_value);
37 emit valueChanged(cur_value);
41 void ZoomWidget::setRange(double min, double max)
43 zoom->setRange(min, max);
46 void ZoomWidget::setSingleStep(double val)
48 zoom->setSingleStep(val);
51 double ZoomWidget::singleStep() const
53 return zoom->singleStep();
56 double ZoomWidget::minimum() const
58 return zoom->minimum();
61 double ZoomWidget::maximum() const
63 return zoom->maximum();