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 QLabel *zoomLabel = new QLabel();
18 zoomLabel->setPixmap(QIcon(":/icons/viewmag.png").pixmap(16, 16));
19 QHBoxLayout *layout = new QHBoxLayout;
20 layout->addWidget(zoomLabel);
21 layout->addWidget(&zoom);
24 setToolTip(tr("Zoom"));
25 setWhatsThis(tr("Zoom magnification factor (base pairs per pixel)"));
28 void ZoomWidget::setValue(double value)
30 if (cur_value != value)
33 zoom.setValue(cur_value);
34 emit valueChanged(cur_value);
38 void ZoomWidget::setRange(double min, double max)
40 zoom.setRange(min, max);
43 void ZoomWidget::setSingleStep(double val)
45 zoom.setSingleStep(val);
48 double ZoomWidget::singleStep() const
50 return zoom.singleStep();
53 double ZoomWidget::minimum() const
55 return zoom.minimum();
58 double ZoomWidget::maximum() const
60 return zoom.maximum();