+#include <QHBoxLayout>
+#include <QIcon>
+#include <QLabel>
+
+#include "qui/ZoomWidget.hpp"
+#include <iostream>
+using namespace std;
+
+ZoomWidget::ZoomWidget(QWidget *parent)
+ : QWidget(parent),
+ max_zoom_size(10000)
+{
+ zoom.setRange(0.01, max_zoom_size);
+ zoom.setSingleStep(0.1);
+ connect(&zoom, SIGNAL(valueChanged(double)), this, SLOT(setValue(double)));
+
+ QLabel *zoomLabel = new QLabel();
+ zoomLabel->setPixmap(QIcon(":/icons/viewmag.png").pixmap(16, 16));
+ QHBoxLayout *layout = new QHBoxLayout;
+ layout->addWidget(zoomLabel);
+ layout->addWidget(&zoom);
+ setLayout(layout);
+
+ setToolTip(tr("Zoom"));
+ setWhatsThis(tr("Zoom magnification factor (base pairs per pixel)"));
+}
+
+void ZoomWidget::setValue(double value)
+{
+ if (cur_value != value)
+ {
+ cur_value = value;
+ zoom.setValue(cur_value);
+ emit valueChanged(cur_value);
+ }
+}
+
+void ZoomWidget::setRange(double min, double max)
+{
+ zoom.setRange(min, max);
+}
+
+void ZoomWidget::setSingleStep(double val)
+{
+ zoom.setSingleStep(val);
+}
+
+double ZoomWidget::singleStep() const
+{
+ return zoom.singleStep();
+}
+
+double ZoomWidget::minimum() const
+{
+ return zoom.minimum();
+}
+
+double ZoomWidget::maximum() const
+{
+ return zoom.maximum();
+}
+