From 038cb3b97393ede6e0dc8d9e788108265b58bfd3 Mon Sep 17 00:00:00 2001
From: Jon Beniston <jon@beniston.com>
Date: Tue, 20 Dec 2022 11:31:01 +0000
Subject: [PATCH 1/2] Add pinch gesture to GraphicsViewZoom

---
 sdrgui/gui/graphicsviewzoom.cpp | 17 +++++++++++++++++
 sdrgui/gui/graphicsviewzoom.h   |  4 ++--
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/sdrgui/gui/graphicsviewzoom.cpp b/sdrgui/gui/graphicsviewzoom.cpp
index a210cfb07..4ab6daca5 100644
--- a/sdrgui/gui/graphicsviewzoom.cpp
+++ b/sdrgui/gui/graphicsviewzoom.cpp
@@ -18,6 +18,9 @@
 #include <QMouseEvent>
 #include <QApplication>
 #include <QScrollBar>
+#include <QGestureEvent>
+#include <QPinchGesture>
+
 #include <qmath.h>
 
 #include "graphicsviewzoom.h"
@@ -30,6 +33,7 @@ GraphicsViewZoom::GraphicsViewZoom(QGraphicsView* view) :
 {
     m_view->viewport()->installEventFilter(this);
     m_view->setMouseTracking(true);
+    m_view->viewport()->grabGesture(Qt::PinchGesture);
 }
 
 void GraphicsViewZoom::gentleZoom(double factor)
@@ -79,6 +83,19 @@ bool GraphicsViewZoom::eventFilter(QObject *object, QEvent *event)
             }
         }
     }
+    else if (event->type() == QEvent::Gesture)
+    {
+        QGestureEvent *gestureEvent = static_cast<QGestureEvent *>(event);
+        if (QPinchGesture *pinchGesture = static_cast<QPinchGesture *>(gestureEvent->gesture(Qt::PinchGesture)))
+        {
+            if (pinchGesture->changeFlags() & QPinchGesture::ScaleFactorChanged)
+            {
+                m_view->scale(pinchGesture->scaleFactor(), pinchGesture->scaleFactor());
+                emit zoomed();
+            }
+            return true;
+        }
+    }
 
     Q_UNUSED(object)
     return false;
diff --git a/sdrgui/gui/graphicsviewzoom.h b/sdrgui/gui/graphicsviewzoom.h
index 7751b4454..0e4af0e6b 100644
--- a/sdrgui/gui/graphicsviewzoom.h
+++ b/sdrgui/gui/graphicsviewzoom.h
@@ -23,7 +23,7 @@
 
 #include "export.h"
 
-// GraphicsView that allows scroll wheel to be used for zoom
+// GraphicsView that allows scroll wheel and pinch gesture to be used for zoom
 // https://stackoverflow.com/questions/19113532/qgraphicsview-zooming-in-and-out-under-mouse-position-using-mouse-wheel
 class SDRGUI_API GraphicsViewZoom : public QObject {
     Q_OBJECT
@@ -39,7 +39,7 @@ private:
     Qt::KeyboardModifiers m_modifiers;
     double m_zoomFactorBase;
     QPointF m_targetScenePos, m_targetViewportPos;
-    bool eventFilter(QObject* object, QEvent* event);
+    bool eventFilter(QObject* object, QEvent* event) override;
 
 signals:
     void zoomed();

From 1c9cc7a989a0ffa3a8d45f2c8bff146807525cea Mon Sep 17 00:00:00 2001
From: Jon Beniston <jon@beniston.com>
Date: Tue, 20 Dec 2022 14:39:39 +0000
Subject: [PATCH 2/2] GLSpectrum touchscreen updates

Add "show all controls" button, that allows most of the "set once"
controls to be hidden on small screens. Please feel free to make a
better icon! Could also be hidden if !ANDROID, if you don't like it.
Add pinch and pan gestures, for frequency scrolling and zooming in to
spectrum.
Queue frequencies requested by scrolling, so intermediate frequencies
can be omitted, if device is slow to update its frequency.
Support non-integer pixel ratios.
Add popup sliders for dials.
Add DialogPositioner for dialogs.
Add layout to spectrum markers dialog, so that it can be resized, to fit
on smaller screens.
---
 sdrbase/dsp/spectrumsettings.cpp    |   11 +
 sdrbase/dsp/spectrumsettings.h      |    1 +
 sdrgui/gui/glshadercolormap.cpp     |    4 +
 sdrgui/gui/glshaderspectrogram.cpp  |    6 +-
 sdrgui/gui/glshadertextured.cpp     |    8 +
 sdrgui/gui/glspectrumgui.cpp        |   51 +-
 sdrgui/gui/glspectrumgui.h          |    2 +
 sdrgui/gui/glspectrumgui.ui         |   23 +
 sdrgui/gui/glspectrumview.cpp       |  174 +-
 sdrgui/gui/glspectrumview.h         |   13 +-
 sdrgui/gui/spectrummarkersdialog.ui | 3395 ++++++++++++++-------------
 11 files changed, 1998 insertions(+), 1690 deletions(-)

diff --git a/sdrbase/dsp/spectrumsettings.cpp b/sdrbase/dsp/spectrumsettings.cpp
index 122981c8c..5ab12a246 100644
--- a/sdrbase/dsp/spectrumsettings.cpp
+++ b/sdrbase/dsp/spectrumsettings.cpp
@@ -80,6 +80,11 @@ void SpectrumSettings::resetToDefaults()
     m_measurementsPosition = PositionBelow;
     m_measurementPrecision = 1;
     m_findHistogramPeaks = false;
+#ifdef ANDROID
+    m_showAllControls = false;
+#else
+    m_showAllControls = true;
+#endif
 }
 
 QByteArray SpectrumSettings::serialize() const
@@ -132,6 +137,7 @@ QByteArray SpectrumSettings::serialize() const
     s.writeS32(46, m_measurementCenterFrequencyOffset);
     s.writeBool(47, m_findHistogramPeaks);
     s.writeBool(48, m_truncateFreqScale);
+    s.writeBool(49, m_showAllControls);
     s.writeS32(100, m_histogramMarkers.size());
 
 	for (int i = 0; i < m_histogramMarkers.size(); i++) {
@@ -236,6 +242,11 @@ bool SpectrumSettings::deserialize(const QByteArray& data)
         d.readS32(46, &m_measurementCenterFrequencyOffset, 0);
         d.readBool(47, &m_findHistogramPeaks, false);
         d.readBool(48, &m_truncateFreqScale, false);
+#ifdef ANDROID
+        d.readBool(49, &m_showAllControls, false);
+#else
+        d.readBool(49, &m_showAllControls, true);
+#endif
 
 		int histogramMarkersSize;
 		d.readS32(100, &histogramMarkersSize, 0);
diff --git a/sdrbase/dsp/spectrumsettings.h b/sdrbase/dsp/spectrumsettings.h
index 04d1fe328..d88607d74 100644
--- a/sdrbase/dsp/spectrumsettings.h
+++ b/sdrbase/dsp/spectrumsettings.h
@@ -138,6 +138,7 @@ public:
     bool m_measurementHighlight;
     MeasurementsPosition m_measurementsPosition;
     int m_measurementPrecision;
+    bool m_showAllControls;
 
 	static const int m_log2FFTSizeMin = 6;   // 64
 	static const int m_log2FFTSizeMax = 15;  // 32k
diff --git a/sdrgui/gui/glshadercolormap.cpp b/sdrgui/gui/glshadercolormap.cpp
index f1d2bb464..6582884de 100644
--- a/sdrgui/gui/glshadercolormap.cpp
+++ b/sdrgui/gui/glshadercolormap.cpp
@@ -24,6 +24,10 @@
 #include <QVector4D>
 #include <QDebug>
 
+#ifdef ANDROID
+#include <GLES3/gl3.h>
+#endif
+
 #include "gui/glshadercolormap.h"
 #include "util/colormap.h"
 
diff --git a/sdrgui/gui/glshaderspectrogram.cpp b/sdrgui/gui/glshaderspectrogram.cpp
index 10d3d0dc4..47f08f137 100644
--- a/sdrgui/gui/glshaderspectrogram.cpp
+++ b/sdrgui/gui/glshaderspectrogram.cpp
@@ -26,6 +26,10 @@
 #include <QVector4D>
 #include <QDebug>
 
+#ifdef ANDROID
+#include <GLES3/gl3.h>
+#endif
+
 #include "gui/glshaderspectrogram.h"
 #include "util/colormap.h"
 
@@ -314,7 +318,7 @@ void GLShaderSpectrogram::initTextureMutable(const QImage& image)
 
     glGenTextures(1, &m_textureId);
     glBindTexture(GL_TEXTURE_2D, m_textureId);
-    glTexImage2D(GL_TEXTURE_2D, 0, GL_RED,
+    glTexImage2D(GL_TEXTURE_2D, 0, GL_R8,
         image.width(), image.height(), 0, GL_RED, GL_UNSIGNED_BYTE, image.constScanLine(0));
 
     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
diff --git a/sdrgui/gui/glshadertextured.cpp b/sdrgui/gui/glshadertextured.cpp
index 07fc43a8c..4105672f6 100644
--- a/sdrgui/gui/glshadertextured.cpp
+++ b/sdrgui/gui/glshadertextured.cpp
@@ -24,6 +24,10 @@
 #include <QVector4D>
 #include <QDebug>
 
+#ifdef ANDROID
+#include <GLES3/gl3.h>
+#endif
+
 #include "gui/glshadertextured.h"
 
 GLShaderTextured::GLShaderTextured() :
@@ -296,7 +300,11 @@ bool GLShaderTextured::useImmutableStorage()
         GLuint textureId;
         glGenTextures(1, &textureId);
         glBindTexture(GL_TEXTURE_2D, textureId);
+#ifdef ANDROID
+        glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA, 1, 1);
+#else
         glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, 1, 1);
+#endif
         glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, GL_RGBA, GL_UNSIGNED_BYTE, &data);
         GLenum err = glGetError();
         glDeleteTextures(1, &textureId);
diff --git a/sdrgui/gui/glspectrumgui.cpp b/sdrgui/gui/glspectrumgui.cpp
index 4b655bfd9..f2a5923b4 100644
--- a/sdrgui/gui/glspectrumgui.cpp
+++ b/sdrgui/gui/glspectrumgui.cpp
@@ -37,6 +37,8 @@
 #include "gui/spectrummeasurementsdialog.h"
 #include "gui/spectrummeasurements.h"
 #include "gui/flowlayout.h"
+#include "gui/dialogpositioner.h"
+#include "gui/dialpopup.h"
 #include "util/colormap.h"
 #include "util/simpleserializer.h"
 #include "util/db.h"
@@ -94,6 +96,8 @@ GLSpectrumGUI::GLSpectrumGUI(QWidget* parent) :
     CRightClickEnabler *calibrationPointsRightClickEnabler = new CRightClickEnabler(ui->calibration);
     connect(calibrationPointsRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(openCalibrationPointsDialog(const QPoint &)));
 
+    DialPopup::addPopupsToChildDials(this);
+
     displaySettings();
     setAveragingCombo();
     applySettings();
@@ -168,6 +172,7 @@ void GLSpectrumGUI::updateSettings()
 void GLSpectrumGUI::displaySettings()
 {
     blockApplySettings(true);
+    ui->showAllControls->setChecked(m_settings.m_showAllControls);
     ui->refLevel->setValue(m_settings.m_refLevel + m_calibrationShiftdB);
     ui->levelRange->setValue(m_settings.m_powerRange);
     ui->decay->setSliderPosition(m_settings.m_decay);
@@ -176,7 +181,7 @@ void GLSpectrumGUI::displaySettings()
     ui->waterfall->setChecked(m_settings.m_displayWaterfall);
     ui->spectrogram->setChecked(m_settings.m_display3DSpectrogram);
     ui->spectrogramStyle->setCurrentIndex((int) m_settings.m_3DSpectrogramStyle);
-    ui->spectrogramStyle->setVisible(m_settings.m_display3DSpectrogram);
+    ui->spectrogramStyle->setVisible(m_settings.m_display3DSpectrogram && m_settings.m_showAllControls);
     ui->colorMap->setCurrentText(m_settings.m_colorMap);
     ui->currentLine->blockSignals(true);
     ui->currentFill->blockSignals(true);
@@ -236,6 +241,7 @@ void GLSpectrumGUI::displaySettings()
     setAveragingToolitp();
     ui->calibration->setChecked(m_settings.m_useCalibration);
     displayGotoMarkers();
+    displayControls();
 
     ui->fftWindow->blockSignals(false);
     ui->averaging->blockSignals(false);
@@ -246,6 +252,37 @@ void GLSpectrumGUI::displaySettings()
     updateMeasurements();
 }
 
+void GLSpectrumGUI::displayControls()
+{
+    ui->grid->setVisible(m_settings.m_showAllControls);
+    ui->gridIntensity->setVisible(m_settings.m_showAllControls);
+    ui->truncateScale->setVisible(m_settings.m_showAllControls);
+    ui->clearSpectrum->setVisible(m_settings.m_showAllControls);
+    ui->histogram->setVisible(m_settings.m_showAllControls);
+    ui->maxHold->setVisible(m_settings.m_showAllControls);
+    ui->decay->setVisible(m_settings.m_showAllControls);
+    ui->decayDivisor->setVisible(m_settings.m_showAllControls);
+    ui->stroke->setVisible(m_settings.m_showAllControls);
+    ui->currentLine->setVisible(m_settings.m_showAllControls);
+    ui->currentFill->setVisible(m_settings.m_showAllControls);
+    ui->currentGradient->setVisible(m_settings.m_showAllControls);
+    ui->traceIntensity->setVisible(m_settings.m_showAllControls);
+    ui->colorMap->setVisible(m_settings.m_showAllControls);
+    ui->invertWaterfall->setVisible(m_settings.m_showAllControls);
+    ui->waterfall->setVisible(m_settings.m_showAllControls);
+    ui->spectrogram->setVisible(m_settings.m_showAllControls);
+    ui->spectrogramStyle->setVisible(m_settings.m_showAllControls);
+    ui->fftWindow->setVisible(m_settings.m_showAllControls);
+    ui->fftSize->setVisible(m_settings.m_showAllControls);
+    ui->fftOverlap->setVisible(m_settings.m_showAllControls);
+    ui->fps->setVisible(m_settings.m_showAllControls);
+    ui->linscale->setVisible(m_settings.m_showAllControls);
+    ui->save->setVisible(m_settings.m_showAllControls);
+    ui->wsSpectrum->setVisible(m_settings.m_showAllControls);
+    ui->calibration->setVisible(m_settings.m_showAllControls);
+    ui->markers->setVisible(m_settings.m_showAllControls);
+}
+
 void GLSpectrumGUI::displayGotoMarkers()
 {
     ui->gotoMarker->clear();
@@ -484,6 +521,7 @@ void GLSpectrumGUI::on_markers_clicked(bool checked)
     QRect mouseScreenGeometry = screen->geometry();
     QPoint localCursorPos = globalCursorPos - mouseScreenGeometry.topLeft();
     m_markersDialog->move(localCursorPos);
+    new DialogPositioner(m_markersDialog, false);
 
     m_markersDialog->show();
 }
@@ -616,7 +654,7 @@ void GLSpectrumGUI::on_spectrogram_toggled(bool checked)
         ui->waterfall->setChecked(false);
         blockApplySettings(false);
     }
-    ui->spectrogramStyle->setVisible(m_settings.m_display3DSpectrogram);
+    ui->spectrogramStyle->setVisible(m_settings.m_display3DSpectrogram && m_settings.m_showAllControls);
     applySettings();
 }
 
@@ -677,6 +715,13 @@ void GLSpectrumGUI::on_invertWaterfall_toggled(bool checked)
     applySettings();
 }
 
+void GLSpectrumGUI::on_showAllControls_toggled(bool checked)
+{
+    m_settings.m_showAllControls = checked;
+    displayControls();
+    applySettings();
+}
+
 void GLSpectrumGUI::on_grid_toggled(bool checked)
 {
     m_settings.m_displayGrid = checked;
@@ -987,6 +1032,7 @@ void GLSpectrumGUI::openWebsocketSpectrumSettingsDialog(const QPoint& p)
     dialog.setPort(m_settings.m_wsSpectrumPort);
 
     dialog.move(p);
+    new DialogPositioner(&dialog, false);
     dialog.exec();
 
     if (dialog.hasChanged())
@@ -1010,6 +1056,7 @@ void GLSpectrumGUI::openCalibrationPointsDialog(const QPoint& p)
     dialog.setCenterFrequency(m_glSpectrum->getCenterFrequency());
     connect(&dialog, SIGNAL(updateCalibrationPoints()), this, SLOT(updateCalibrationPoints()));
     dialog.move(p);
+    new DialogPositioner(&dialog, false);
     dialog.exec();
 
     m_settings.m_histogramMarkers = m_glSpectrum->getHistogramMarkers();
diff --git a/sdrgui/gui/glspectrumgui.h b/sdrgui/gui/glspectrumgui.h
index 3d3f47c8e..ac55d0ebc 100644
--- a/sdrgui/gui/glspectrumgui.h
+++ b/sdrgui/gui/glspectrumgui.h
@@ -79,6 +79,7 @@ private:
 	void applySettings();
     void applySpectrumSettings();
     void displaySettings();
+    void displayControls();
 	void setAveragingCombo();
 	void setNumberStr(int n, QString& s);
 	void setNumberStr(float v, int decimalPlaces, QString& s);
@@ -125,6 +126,7 @@ private slots:
     void on_freeze_toggled(bool checked);
 	void on_calibration_toggled(bool checked);
     void on_gotoMarker_currentIndexChanged(int index);
+    void on_showAllControls_toggled(bool checked);
 
     void on_measure_clicked(bool checked);
 
diff --git a/sdrgui/gui/glspectrumgui.ui b/sdrgui/gui/glspectrumgui.ui
index cc9ef8907..c389f5020 100644
--- a/sdrgui/gui/glspectrumgui.ui
+++ b/sdrgui/gui/glspectrumgui.ui
@@ -1130,6 +1130,29 @@
        </property>
       </widget>
      </item>
+     <item>
+      <widget class="ButtonSwitch" name="showAllControls">
+       <property name="toolTip">
+        <string>Toggle all controls</string>
+       </property>
+       <property name="text">
+        <string>Grid</string>
+       </property>
+       <property name="icon">
+        <iconset resource="../resources/res.qrc">
+         <normaloff>:/listing.png</normaloff>:/listing.png</iconset>
+       </property>
+       <property name="iconSize">
+        <size>
+         <width>16</width>
+         <height>16</height>
+        </size>
+       </property>
+       <property name="checkable">
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
      <item>
       <widget class="QComboBox" name="gotoMarker">
        <property name="minimumSize">
diff --git a/sdrgui/gui/glspectrumview.cpp b/sdrgui/gui/glspectrumview.cpp
index 5532a3a28..7e9bd092b 100644
--- a/sdrgui/gui/glspectrumview.cpp
+++ b/sdrgui/gui/glspectrumview.cpp
@@ -24,6 +24,9 @@
 #include <QPainter>
 #include <QFontDatabase>
 #include <QWindow>
+#include <QGestureEvent>
+#include <QPanGesture>
+#include <QPinchGesture>
 #include "maincore.h"
 #include "dsp/spectrumvis.h"
 #include "gui/glspectrumview.h"
@@ -98,6 +101,10 @@ GLSpectrumView::GLSpectrumView(QWidget* parent) :
     m_colorMapName("Angel"),
     m_scrollFrequency(false),
     m_scrollStartCenterFreq(0),
+    m_pinching(false),
+    m_pinching3D(false),
+    m_frequencyRequested(false),
+    m_nextFrequencyValid(false),
     m_histogramBuffer(nullptr),
     m_histogram(nullptr),
     m_displayHistogram(true),
@@ -223,6 +230,8 @@ GLSpectrumView::GLSpectrumView(QWidget* parent) :
     // Handle KeyEvents
     setFocusPolicy(Qt::StrongFocus);
     installEventFilter(this);
+
+    grabGesture(Qt::PinchGesture);
 }
 
 GLSpectrumView::~GLSpectrumView()
@@ -260,11 +269,37 @@ GLSpectrumView::~GLSpectrumView()
     }
 }
 
+void GLSpectrumView::queueRequestCenterFrequency(qint64 frequency)
+{
+    if (!m_frequencyRequested)
+    {
+        m_frequencyRequested = true;
+        m_requestedFrequency = frequency;
+        emit requestCenterFrequency(frequency);
+    }
+    else
+    {
+        m_nextFrequencyValid = true;
+        m_nextFrequency = frequency;
+    }
+}
+
 void GLSpectrumView::setCenterFrequency(qint64 frequency)
 {
     m_mutex.lock();
     m_centerFrequency = frequency;
 
+    // Handle queued frequency requests
+    if (m_frequencyRequested && (frequency == m_requestedFrequency))
+    {
+        m_frequencyRequested = false;
+        if (m_nextFrequencyValid)
+        {
+            m_nextFrequencyValid = false;
+            queueRequestCenterFrequency(m_nextFrequency);
+        }
+    }
+
     if (m_useCalibration) {
         updateCalibrationPoints();
     }
@@ -944,7 +979,7 @@ void GLSpectrumView::paintGL()
     glFunctions->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 
     QMatrix4x4 spectrogramGridMatrix;
-    int devicePixelRatio;
+    float devicePixelRatio;
 
     if (m_display3DSpectrogram)
     {
@@ -972,7 +1007,7 @@ void GLSpectrumView::paintGL()
         if (window()->windowHandle()) {
             devicePixelRatio = window()->windowHandle()->devicePixelRatio();
         } else {
-            devicePixelRatio = 1;
+            devicePixelRatio = 1.0f;
         }
         glFunctions->glViewport(0, m_3DSpectrogramBottom*devicePixelRatio, width()*devicePixelRatio, m_waterfallHeight*devicePixelRatio);
         m_glShaderSpectrogram.drawSurface(m_3DSpectrogramStyle, spectrogramGridMatrix, prop_y, m_invertedWaterfall);
@@ -3676,9 +3711,81 @@ void GLSpectrumView::updateCalibrationPoints()
     m_changesPending = true;
 }
 
+bool GLSpectrumView::event(QEvent* event)
+{
+    if (event->type() == QEvent::Gesture)
+    {
+        QGestureEvent *gestureEvent = static_cast<QGestureEvent *>(event);
+
+        if (QPanGesture *pan = static_cast<QPanGesture *>(gestureEvent->gesture(Qt::PanGesture)))
+        {
+            if (pan->state() == Qt::GestureStarted)
+            {
+                m_scrollStartCenterFreq = m_centerFrequency;
+            }
+            else if (pan->state() == Qt::GestureUpdated)
+            {
+                QPointF offset = pan->offset();
+                float histogramWidth = width() - m_leftMargin - m_rightMargin;
+                qint64 frequency = (qint64)(m_scrollStartCenterFreq + -offset.x()/histogramWidth * m_frequencyScale.getRange());
+                queueRequestCenterFrequency(frequency);
+            }
+            return true;
+        }
+        else if (QPinchGesture *pinch = static_cast<QPinchGesture *>(gestureEvent->gesture(Qt::PinchGesture)))
+        {
+            // Don't get GestureStarted and startCenterPoint is always 0,0
+            // https://bugreports.qt.io/browse/QTBUG-109205
+            if (!m_pinching)
+            {
+                m_scrollStartCenterFreq = m_centerFrequency;
+                m_pinchStart = pinch->centerPoint();
+                m_pinching = true;
+                m_pinching3D = m_display3DSpectrogram && pointInWaterfallOrSpectrogram(mapFromGlobal(m_pinchStart.toPoint()));
+            }
+            else
+            {
+                if (pinch->changeFlags() & QPinchGesture::CenterPointChanged)
+                {
+                    if (!m_pinching3D)
+                    {
+                        // Scroll frequency up or down
+                        QPointF offset = pinch->centerPoint() - m_pinchStart;
+                        float histogramWidth = width() - m_leftMargin - m_rightMargin;
+                        qint64 frequency = (qint64)(m_scrollStartCenterFreq + -offset.x()/histogramWidth * m_frequencyScale.getRange());
+                        queueRequestCenterFrequency(frequency);
+                    }
+                }
+                if (pinch->changeFlags() & QPinchGesture::ScaleFactorChanged)
+                {
+                    if (!m_pinching3D)
+                    {
+                        // Zoom in/out of spectrum
+                        QPoint p = mapFromGlobal(pinch->centerPoint().toPoint());
+                        zoomFactor(p, pinch->scaleFactor());
+                    }
+                    else
+                    {
+                        // Scale Z axis of 3D spectragram
+                        m_glShaderSpectrogram.userScaleZ(pinch->scaleFactor());
+                    }
+                }
+                if (pinch->state() == Qt::GestureFinished)
+                {
+                    m_pinching = false;
+                    m_pinching3D = false;
+                }
+            }
+            return true;
+        }
+    }
+
+    return QOpenGLWidget::event(event);
+}
+
 void GLSpectrumView::mouseMoveEvent(QMouseEvent* event)
 {
-    if (m_rotate3DSpectrogram)
+    if (m_rotate3DSpectrogram && !m_pinching3D)
     {
         // Rotate 3D Spectrogram
         QPointF delta = m_mousePrevLocalPos - event->localPos();
@@ -3718,7 +3825,7 @@ void GLSpectrumView::mouseMoveEvent(QMouseEvent* event)
         QPointF delta = m_mousePrevLocalPos - event->localPos();
         float histogramWidth = width() - m_leftMargin - m_rightMargin;
         qint64 frequency = (qint64)(m_scrollStartCenterFreq + delta.x()/histogramWidth * m_frequencyScale.getRange());
-        emit requestCenterFrequency(frequency);
+        queueRequestCenterFrequency(frequency);
         return;
     }
 
@@ -3775,13 +3882,14 @@ void GLSpectrumView::mouseMoveEvent(QMouseEvent* event)
     {
         // Determine if user is trying to move the channel outside of the current frequency range
         // and if so, request an adjustment to the center frequency
+        // FIXME: This doesn't take zoom into account, so only works when zoomed out
         Real freqAbs = m_frequencyScale.getValueFromPos(event->x() - m_leftMarginPixmap.width() - 1);
         Real freqMin = m_centerFrequency - m_sampleRate / 2.0f;
         Real freqMax = m_centerFrequency + m_sampleRate / 2.0f;
         if (freqAbs < freqMin) {
-            emit requestCenterFrequency(m_centerFrequency - (freqMin - freqAbs));
+            queueRequestCenterFrequency(m_centerFrequency - (freqMin - freqAbs));
         } else if (freqAbs > freqMax) {
-            emit requestCenterFrequency(m_centerFrequency + (freqAbs - freqMax));
+            queueRequestCenterFrequency(m_centerFrequency + (freqAbs - freqMax));
         }
 
         Real freq = freqAbs - m_centerFrequency;
@@ -4174,14 +4282,8 @@ void GLSpectrumView::wheelEvent(QWheelEvent *event)
     }
 }
 
-void GLSpectrumView::zoom(QWheelEvent *event)
+void GLSpectrumView::zoomFactor(const QPointF& p, float factor)
 {
-#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
-    const QPointF& p = event->position();
-#else
-    const QPointF& p = event->pos();
-#endif
-
     float pwx = (p.x() - m_leftMargin) / (width() - m_leftMargin - m_rightMargin); // x position in window
 
     if ((pwx >= 0.0f) && (pwx <= 1.0f))
@@ -4200,7 +4302,45 @@ void GLSpectrumView::zoom(QWheelEvent *event)
         // Calculate what that difference would be if there was no zoom
         float freqDiffZoom1 = freqDiff * m_frequencyZoomFactor;
 
-        if (event->angleDelta().y() > 0) // zoom in
+        m_frequencyZoomFactor *= factor;
+        m_frequencyZoomFactor = std::min(m_frequencyZoomFactor, m_maxFrequencyZoom);
+        m_frequencyZoomFactor = std::max(m_frequencyZoomFactor, 1.0f);
+
+        // Calculate what frequency difference should be at new zoom
+        float zoomedFreqDiff = freqDiffZoom1 / m_frequencyZoomFactor;
+        // Then calculate what the center frequency should be
+        float zoomedCF = zoomFreq + zoomedFreqDiff;
+
+        // Calculate zoom position which will set the desired center frequency
+        float zoomPos = (zoomedCF - m_centerFrequency) / m_sampleRate + 0.5;
+        zoomPos = std::max(0.0f, zoomPos);
+        zoomPos = std::min(1.0f, zoomPos);
+
+        frequencyZoom(zoomPos);
+    }
+ }
+
+void GLSpectrumView::zoom(const QPointF& p, int y)
+{
+    float pwx = (p.x() - m_leftMargin) / (width() - m_leftMargin - m_rightMargin); // x position in window
+
+    if ((pwx >= 0.0f) && (pwx <= 1.0f))
+    {
+        // When we zoom, we want the frequency under the cursor to remain the same
+
+        // Determine frequency at cursor position
+        float zoomFreq = m_frequencyScale.getRangeMin() + pwx*m_frequencyScale.getRange();
+
+        // Calculate current centre frequency
+        float currentCF = (m_frequencyZoomFactor == 1) ? m_centerFrequency : ((m_frequencyZoomPos - 0.5) * m_sampleRate + m_centerFrequency);
+
+        // Calculate difference from frequency under cursor to centre frequency
+        float freqDiff = (currentCF - zoomFreq);
+
+        // Calculate what that difference would be if there was no zoom
+        float freqDiffZoom1 = freqDiff * m_frequencyZoomFactor;
+
+        if (y > 0) // zoom in
         {
             if (m_frequencyZoomFactor < m_maxFrequencyZoom) {
                 m_frequencyZoomFactor += 0.5f;
@@ -4247,11 +4387,11 @@ void GLSpectrumView::zoom(QWheelEvent *event)
         //qDebug("GLSpectrumView::zoom: pwyh: %f pwyw: %f", pwyh, pwyw);
 
         if ((pwyw >= 0.0f) && (pwyw <= 1.0f)) {
-            timeZoom(event->angleDelta().y() > 0);
+            timeZoom(y > 0);
         }
 
         if ((pwyh >= 0.0f) && (pwyh <= 1.0f) && !m_linear) {
-            powerZoom(pwyh, event->angleDelta().y() > 0);
+            powerZoom(pwyh, y > 0);
         }
     }
 }
@@ -4427,7 +4567,7 @@ void GLSpectrumView::channelMarkerMove(QWheelEvent *event, int mul)
         }
     }
 
-    zoom(event);
+    zoom(event->position(), event->angleDelta().y());
 }
 
 // Return if specified point is within the bounds of the waterfall / 3D spectrogram screen area
diff --git a/sdrgui/gui/glspectrumview.h b/sdrgui/gui/glspectrumview.h
index 74101b6a9..77bf8565c 100644
--- a/sdrgui/gui/glspectrumview.h
+++ b/sdrgui/gui/glspectrumview.h
@@ -358,6 +358,14 @@ private:
 
     bool m_scrollFrequency;
     qint64 m_scrollStartCenterFreq;
+    bool m_pinching;
+    bool m_pinching3D;
+    QPointF m_pinchStart;
+
+    bool m_frequencyRequested;      //!< Set when we have emitted requestCenterFrequency
+    qint64 m_requestedFrequency;
+    qint64 m_nextFrequency;         //!< Next frequency to request when previous request completes
+    qint64 m_nextFrequencyValid;
 
     QRgb m_histogramPalette[240];
     QImage* m_histogramBuffer;
@@ -448,12 +456,14 @@ private:
     void stopDrag();
     void applyChanges();
 
+    bool event(QEvent* event);
     void mouseMoveEvent(QMouseEvent* event);
     void mousePressEvent(QMouseEvent* event);
     void mouseReleaseEvent(QMouseEvent* event);
     void wheelEvent(QWheelEvent*);
     void channelMarkerMove(QWheelEvent*, int mul);
-    void zoom(QWheelEvent*);
+    void zoomFactor(const QPointF& p, float factor);
+    void zoom(const QPointF& p, int y);
     void frequencyZoom(float pw);
     void frequencyPan(QMouseEvent*);
     void timeZoom(bool zoomInElseOut);
@@ -494,6 +504,7 @@ private:
             const QRectF& glRect);
     void formatTextInfo(QString& info);
     void updateSortedAnnotationMarkers();
+    void queueRequestCenterFrequency(qint64 frequency);
 
     static bool annotationDisplayLessThan(const SpectrumAnnotationMarker *m1, const SpectrumAnnotationMarker *m2)
     {
diff --git a/sdrgui/gui/spectrummarkersdialog.ui b/sdrgui/gui/spectrummarkersdialog.ui
index f8b2cd874..e3dfb1ed8 100644
--- a/sdrgui/gui/spectrummarkersdialog.ui
+++ b/sdrgui/gui/spectrummarkersdialog.ui
@@ -7,13 +7,13 @@
     <x>0</x>
     <y>0</y>
     <width>480</width>
-    <height>300</height>
+    <height>250</height>
    </rect>
   </property>
   <property name="minimumSize">
    <size>
-    <width>480</width>
-    <height>300</height>
+    <width>410</width>
+    <height>250</height>
    </size>
   </property>
   <property name="font">
@@ -38,490 +38,511 @@
       <attribute name="toolTip">
        <string>Histogram (spectrum line) markers</string>
       </attribute>
-      <widget class="QWidget" name="layoutWidget">
-       <property name="geometry">
-        <rect>
-         <x>0</x>
-         <y>10</y>
-         <width>391</width>
-         <height>74</height>
-        </rect>
+      <layout class="QVBoxLayout" name="verticalLayout_2">
+       <property name="spacing">
+        <number>3</number>
        </property>
-       <layout class="QVBoxLayout" name="HMarkerLayout">
-        <property name="spacing">
-         <number>2</number>
-        </property>
-        <item>
-         <layout class="QHBoxLayout" name="HMarkerPosLayout">
-          <item>
-           <widget class="QLabel" name="markerFrequencyLabel">
-            <property name="text">
-             <string>F</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="ValueDialZ" name="markerFrequency" native="true">
-            <property name="sizePolicy">
-             <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
-              <horstretch>0</horstretch>
-              <verstretch>0</verstretch>
-             </sizepolicy>
-            </property>
-            <property name="minimumSize">
-             <size>
-              <width>32</width>
-              <height>16</height>
-             </size>
-            </property>
-            <property name="font">
-             <font>
-              <family>DejaVu Sans Mono</family>
-              <pointsize>12</pointsize>
-             </font>
-            </property>
-            <property name="cursor">
-             <cursorShape>PointingHandCursor</cursorShape>
-            </property>
-            <property name="focusPolicy">
-             <enum>Qt::StrongFocus</enum>
-            </property>
-            <property name="toolTip">
-             <string>Marker frequency (Hz)</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QLabel" name="markerFrequencyUnits">
-            <property name="sizePolicy">
-             <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
-              <horstretch>0</horstretch>
-              <verstretch>0</verstretch>
-             </sizepolicy>
-            </property>
-            <property name="minimumSize">
-             <size>
-              <width>32</width>
-              <height>16</height>
-             </size>
-            </property>
-            <property name="cursor">
-             <cursorShape>PointingHandCursor</cursorShape>
-            </property>
-            <property name="focusPolicy">
-             <enum>Qt::StrongFocus</enum>
-            </property>
-            <property name="toolTip">
-             <string>Marker frequency (Hz)</string>
-            </property>
-            <property name="text">
-             <string>Hz</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <spacer name="horizontalSpacer">
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-          <item>
-           <widget class="QPushButton" name="centerFrequency">
-            <property name="maximumSize">
-             <size>
-              <width>24</width>
-              <height>24</height>
-             </size>
-            </property>
-            <property name="toolTip">
-             <string>Set marker as reference (index 0)</string>
-            </property>
-            <property name="text">
-             <string>C</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="ClickableLabel" name="markerColor">
-            <property name="minimumSize">
-             <size>
-              <width>16</width>
-              <height>16</height>
-             </size>
-            </property>
-            <property name="maximumSize">
-             <size>
-              <width>16</width>
-              <height>16</height>
-             </size>
-            </property>
-            <property name="toolTip">
-             <string>Current marker color (click to change)</string>
-            </property>
-            <property name="text">
-             <string/>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QCheckBox" name="showMarker">
-            <property name="toolTip">
-             <string>Show this marker</string>
-            </property>
-            <property name="text">
-             <string/>
-            </property>
-            <property name="checked">
-             <bool>true</bool>
-            </property>
-           </widget>
-          </item>
-         </layout>
-        </item>
-        <item>
-         <layout class="QHBoxLayout" name="HMarkerOptionsLayout">
-          <item>
-           <widget class="QLabel" name="markerLabel">
-            <property name="minimumSize">
-             <size>
-              <width>24</width>
-              <height>0</height>
-             </size>
-            </property>
-            <property name="text">
-             <string>Mk</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QLabel" name="markerText">
-            <property name="minimumSize">
-             <size>
-              <width>15</width>
-              <height>0</height>
-             </size>
-            </property>
-            <property name="text">
-             <string>0</string>
-            </property>
-            <property name="alignment">
-             <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QDial" name="marker">
-            <property name="maximumSize">
-             <size>
-              <width>24</width>
-              <height>24</height>
-             </size>
-            </property>
-            <property name="toolTip">
-             <string>Marker index (0 is reference)</string>
-            </property>
-            <property name="maximum">
-             <number>0</number>
-            </property>
-            <property name="pageStep">
-             <number>1</number>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QPushButton" name="setReference">
-            <property name="maximumSize">
-             <size>
-              <width>24</width>
-              <height>24</height>
-             </size>
-            </property>
-            <property name="toolTip">
-             <string>Set marker as reference (index 0)</string>
-            </property>
-            <property name="text">
-             <string>0</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <layout class="QVBoxLayout" name="markerAddRemoveLayout">
-            <property name="spacing">
-             <number>0</number>
-            </property>
-            <item>
-             <widget class="QPushButton" name="markerAdd">
-              <property name="maximumSize">
-               <size>
-                <width>18</width>
-                <height>18</height>
-               </size>
-              </property>
-              <property name="palette">
-               <palette>
-                <active>
-                 <colorrole role="ButtonText">
-                  <brush brushstyle="SolidPattern">
-                   <color alpha="255">
-                    <red>255</red>
-                    <green>255</green>
-                    <blue>255</blue>
-                   </color>
-                  </brush>
-                 </colorrole>
-                </active>
-                <inactive>
-                 <colorrole role="ButtonText">
-                  <brush brushstyle="SolidPattern">
-                   <color alpha="255">
-                    <red>255</red>
-                    <green>255</green>
-                    <blue>255</blue>
-                   </color>
-                  </brush>
-                 </colorrole>
-                </inactive>
-                <disabled>
-                 <colorrole role="ButtonText">
-                  <brush brushstyle="SolidPattern">
-                   <color alpha="255">
-                    <red>190</red>
-                    <green>190</green>
-                    <blue>190</blue>
-                   </color>
-                  </brush>
-                 </colorrole>
-                </disabled>
-               </palette>
-              </property>
-              <property name="font">
-               <font>
-                <family>Liberation Sans</family>
-                <pointsize>10</pointsize>
-               </font>
-              </property>
-              <property name="toolTip">
-               <string>Add a new marker</string>
-              </property>
-              <property name="text">
-               <string>+</string>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <widget class="QPushButton" name="markerDel">
-              <property name="maximumSize">
-               <size>
-                <width>18</width>
-                <height>18</height>
-               </size>
-              </property>
-              <property name="palette">
-               <palette>
-                <active>
-                 <colorrole role="ButtonText">
-                  <brush brushstyle="SolidPattern">
-                   <color alpha="255">
-                    <red>255</red>
-                    <green>255</green>
-                    <blue>255</blue>
-                   </color>
-                  </brush>
-                 </colorrole>
-                </active>
-                <inactive>
-                 <colorrole role="ButtonText">
-                  <brush brushstyle="SolidPattern">
-                   <color alpha="255">
-                    <red>255</red>
-                    <green>255</green>
-                    <blue>255</blue>
-                   </color>
-                  </brush>
-                 </colorrole>
-                </inactive>
-                <disabled>
-                 <colorrole role="ButtonText">
-                  <brush brushstyle="SolidPattern">
-                   <color alpha="255">
-                    <red>190</red>
-                    <green>190</green>
-                    <blue>190</blue>
-                   </color>
-                  </brush>
-                 </colorrole>
-                </disabled>
-               </palette>
-              </property>
-              <property name="font">
-               <font>
-                <family>Liberation Sans</family>
-                <pointsize>10</pointsize>
-               </font>
-              </property>
-              <property name="toolTip">
-               <string>Remove current marker</string>
-              </property>
-              <property name="text">
-               <string>-</string>
-              </property>
-             </widget>
-            </item>
-           </layout>
-          </item>
-          <item>
-           <widget class="QLabel" name="powerLabel">
-            <property name="minimumSize">
-             <size>
-              <width>15</width>
-              <height>0</height>
-             </size>
-            </property>
-            <property name="text">
-             <string>P</string>
-            </property>
-            <property name="alignment">
-             <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QPushButton" name="powerHoldReset">
-            <property name="maximumSize">
-             <size>
-              <width>24</width>
-              <height>24</height>
-             </size>
-            </property>
-            <property name="toolTip">
-             <string>Reset power max hold</string>
-            </property>
-            <property name="text">
-             <string>R</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QComboBox" name="powerMode">
-            <property name="maximumSize">
-             <size>
-              <width>60</width>
-              <height>16777215</height>
-             </size>
-            </property>
-            <property name="toolTip">
-             <string>Man - Set marker power to fixed level
+       <property name="leftMargin">
+        <number>3</number>
+       </property>
+       <property name="topMargin">
+        <number>3</number>
+       </property>
+       <property name="rightMargin">
+        <number>3</number>
+       </property>
+       <property name="bottomMargin">
+        <number>3</number>
+       </property>
+       <item>
+        <layout class="QHBoxLayout" name="HMarkerPosLayout">
+         <item>
+          <widget class="QLabel" name="markerFrequencyLabel">
+           <property name="text">
+            <string>F</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="ValueDialZ" name="markerFrequency" native="true">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="minimumSize">
+            <size>
+             <width>32</width>
+             <height>16</height>
+            </size>
+           </property>
+           <property name="font">
+            <font>
+             <family>DejaVu Sans Mono</family>
+             <pointsize>12</pointsize>
+            </font>
+           </property>
+           <property name="cursor">
+            <cursorShape>PointingHandCursor</cursorShape>
+           </property>
+           <property name="focusPolicy">
+            <enum>Qt::StrongFocus</enum>
+           </property>
+           <property name="toolTip">
+            <string>Marker frequency (Hz)</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLabel" name="markerFrequencyUnits">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="minimumSize">
+            <size>
+             <width>32</width>
+             <height>16</height>
+            </size>
+           </property>
+           <property name="cursor">
+            <cursorShape>PointingHandCursor</cursorShape>
+           </property>
+           <property name="focusPolicy">
+            <enum>Qt::StrongFocus</enum>
+           </property>
+           <property name="toolTip">
+            <string>Marker frequency (Hz)</string>
+           </property>
+           <property name="text">
+            <string>Hz</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer name="horizontalSpacer">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="QPushButton" name="centerFrequency">
+           <property name="maximumSize">
+            <size>
+             <width>24</width>
+             <height>24</height>
+            </size>
+           </property>
+           <property name="toolTip">
+            <string>Set marker as reference (index 0)</string>
+           </property>
+           <property name="text">
+            <string>C</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="ClickableLabel" name="markerColor">
+           <property name="minimumSize">
+            <size>
+             <width>16</width>
+             <height>16</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>16</width>
+             <height>16</height>
+            </size>
+           </property>
+           <property name="toolTip">
+            <string>Current marker color (click to change)</string>
+           </property>
+           <property name="text">
+            <string/>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QCheckBox" name="showMarker">
+           <property name="toolTip">
+            <string>Show this marker</string>
+           </property>
+           <property name="text">
+            <string/>
+           </property>
+           <property name="checked">
+            <bool>true</bool>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="HMarkerOptionsLayout">
+         <item>
+          <widget class="QLabel" name="markerLabel">
+           <property name="minimumSize">
+            <size>
+             <width>24</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="text">
+            <string>Mk</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLabel" name="markerText">
+           <property name="minimumSize">
+            <size>
+             <width>15</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="text">
+            <string>0</string>
+           </property>
+           <property name="alignment">
+            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QDial" name="marker">
+           <property name="maximumSize">
+            <size>
+             <width>24</width>
+             <height>24</height>
+            </size>
+           </property>
+           <property name="toolTip">
+            <string>Marker index (0 is reference)</string>
+           </property>
+           <property name="maximum">
+            <number>0</number>
+           </property>
+           <property name="pageStep">
+            <number>1</number>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QPushButton" name="setReference">
+           <property name="maximumSize">
+            <size>
+             <width>24</width>
+             <height>24</height>
+            </size>
+           </property>
+           <property name="toolTip">
+            <string>Set marker as reference (index 0)</string>
+           </property>
+           <property name="text">
+            <string>0</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <layout class="QVBoxLayout" name="markerAddRemoveLayout">
+           <property name="spacing">
+            <number>0</number>
+           </property>
+           <item>
+            <widget class="QPushButton" name="markerAdd">
+             <property name="maximumSize">
+              <size>
+               <width>18</width>
+               <height>18</height>
+              </size>
+             </property>
+             <property name="palette">
+              <palette>
+               <active>
+                <colorrole role="ButtonText">
+                 <brush brushstyle="SolidPattern">
+                  <color alpha="255">
+                   <red>255</red>
+                   <green>255</green>
+                   <blue>255</blue>
+                  </color>
+                 </brush>
+                </colorrole>
+               </active>
+               <inactive>
+                <colorrole role="ButtonText">
+                 <brush brushstyle="SolidPattern">
+                  <color alpha="255">
+                   <red>255</red>
+                   <green>255</green>
+                   <blue>255</blue>
+                  </color>
+                 </brush>
+                </colorrole>
+               </inactive>
+               <disabled>
+                <colorrole role="ButtonText">
+                 <brush brushstyle="SolidPattern">
+                  <color alpha="255">
+                   <red>190</red>
+                   <green>190</green>
+                   <blue>190</blue>
+                  </color>
+                 </brush>
+                </colorrole>
+               </disabled>
+              </palette>
+             </property>
+             <property name="font">
+              <font>
+               <family>Liberation Sans</family>
+               <pointsize>10</pointsize>
+              </font>
+             </property>
+             <property name="toolTip">
+              <string>Add a new marker</string>
+             </property>
+             <property name="text">
+              <string>+</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QPushButton" name="markerDel">
+             <property name="maximumSize">
+              <size>
+               <width>18</width>
+               <height>18</height>
+              </size>
+             </property>
+             <property name="palette">
+              <palette>
+               <active>
+                <colorrole role="ButtonText">
+                 <brush brushstyle="SolidPattern">
+                  <color alpha="255">
+                   <red>255</red>
+                   <green>255</green>
+                   <blue>255</blue>
+                  </color>
+                 </brush>
+                </colorrole>
+               </active>
+               <inactive>
+                <colorrole role="ButtonText">
+                 <brush brushstyle="SolidPattern">
+                  <color alpha="255">
+                   <red>255</red>
+                   <green>255</green>
+                   <blue>255</blue>
+                  </color>
+                 </brush>
+                </colorrole>
+               </inactive>
+               <disabled>
+                <colorrole role="ButtonText">
+                 <brush brushstyle="SolidPattern">
+                  <color alpha="255">
+                   <red>190</red>
+                   <green>190</green>
+                   <blue>190</blue>
+                  </color>
+                 </brush>
+                </colorrole>
+               </disabled>
+              </palette>
+             </property>
+             <property name="font">
+              <font>
+               <family>Liberation Sans</family>
+               <pointsize>10</pointsize>
+              </font>
+             </property>
+             <property name="toolTip">
+              <string>Remove current marker</string>
+             </property>
+             <property name="text">
+              <string>-</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <widget class="QLabel" name="powerLabel">
+           <property name="minimumSize">
+            <size>
+             <width>15</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="text">
+            <string>P</string>
+           </property>
+           <property name="alignment">
+            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QPushButton" name="powerHoldReset">
+           <property name="maximumSize">
+            <size>
+             <width>24</width>
+             <height>24</height>
+            </size>
+           </property>
+           <property name="toolTip">
+            <string>Reset power max hold</string>
+           </property>
+           <property name="text">
+            <string>R</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QComboBox" name="powerMode">
+           <property name="minimumSize">
+            <size>
+             <width>50</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>60</width>
+             <height>16777215</height>
+            </size>
+           </property>
+           <property name="toolTip">
+            <string>Man - Set marker power to fixed level
 Cur - Marker will move according to current power at the marker frequency
 Max - Marker will move according to the maximum power at the marker frequency</string>
-            </property>
-            <item>
-             <property name="text">
-              <string>Man</string>
-             </property>
-            </item>
-            <item>
-             <property name="text">
-              <string>Cur</string>
-             </property>
-            </item>
-            <item>
-             <property name="text">
-              <string>Max</string>
-             </property>
-            </item>
-           </widget>
-          </item>
-          <item>
-           <widget class="ValueDialZ" name="fixedPower" native="true">
-            <property name="sizePolicy">
-             <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
-              <horstretch>0</horstretch>
-              <verstretch>0</verstretch>
-             </sizepolicy>
-            </property>
-            <property name="minimumSize">
-             <size>
-              <width>32</width>
-              <height>16</height>
-             </size>
-            </property>
-            <property name="font">
-             <font>
-              <family>DejaVu Sans Mono</family>
-              <pointsize>12</pointsize>
-             </font>
-            </property>
-            <property name="cursor">
-             <cursorShape>PointingHandCursor</cursorShape>
-            </property>
-            <property name="focusPolicy">
-             <enum>Qt::StrongFocus</enum>
-            </property>
-            <property name="toolTip">
-             <string>Fixed power (dB)</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QLabel" name="fixedPowerUnits">
-            <property name="minimumSize">
-             <size>
-              <width>32</width>
-              <height>0</height>
-             </size>
-            </property>
+           </property>
+           <item>
             <property name="text">
-             <string>dB</string>
-            </property>
-            <property name="alignment">
-             <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <spacer name="horizontalSpacer_2">
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-          <item>
-           <widget class="ButtonSwitch" name="findPeaks">
-            <property name="maximumSize">
-             <size>
-              <width>24</width>
-              <height>24</height>
-             </size>
-            </property>
-            <property name="toolTip">
-             <string>Put markers in find peaks mode</string>
+             <string>Man</string>
             </property>
+           </item>
+           <item>
             <property name="text">
-             <string/>
+             <string>Cur</string>
             </property>
-            <property name="icon">
-             <iconset resource="../resources/res.qrc">
-              <normaloff>:/dsb.png</normaloff>:/dsb.png</iconset>
+           </item>
+           <item>
+            <property name="text">
+             <string>Max</string>
             </property>
-           </widget>
-          </item>
-         </layout>
-        </item>
-       </layout>
-      </widget>
+           </item>
+          </widget>
+         </item>
+         <item>
+          <widget class="ValueDialZ" name="fixedPower" native="true">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="minimumSize">
+            <size>
+             <width>32</width>
+             <height>16</height>
+            </size>
+           </property>
+           <property name="font">
+            <font>
+             <family>DejaVu Sans Mono</family>
+             <pointsize>12</pointsize>
+            </font>
+           </property>
+           <property name="cursor">
+            <cursorShape>PointingHandCursor</cursorShape>
+           </property>
+           <property name="focusPolicy">
+            <enum>Qt::StrongFocus</enum>
+           </property>
+           <property name="toolTip">
+            <string>Fixed power (dB)</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLabel" name="fixedPowerUnits">
+           <property name="minimumSize">
+            <size>
+             <width>32</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="text">
+            <string>dB</string>
+           </property>
+           <property name="alignment">
+            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer name="horizontalSpacer_2">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="ButtonSwitch" name="findPeaks">
+           <property name="maximumSize">
+            <size>
+             <width>24</width>
+             <height>24</height>
+            </size>
+           </property>
+           <property name="toolTip">
+            <string>Put markers in find peaks mode</string>
+           </property>
+           <property name="text">
+            <string/>
+           </property>
+           <property name="icon">
+            <iconset resource="../resources/res.qrc">
+             <normaloff>:/dsb.png</normaloff>:/dsb.png</iconset>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <spacer name="verticalSpacer">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>40</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
      </widget>
      <widget class="QWidget" name="watTab">
       <attribute name="title">
@@ -530,517 +551,532 @@ Max - Marker will move according to the maximum power at the marker frequency</s
       <attribute name="toolTip">
        <string>Waterfall markers</string>
       </attribute>
-      <widget class="QWidget" name="layoutWidget_1">
-       <property name="geometry">
-        <rect>
-         <x>0</x>
-         <y>10</y>
-         <width>391</width>
-         <height>93</height>
-        </rect>
+      <layout class="QVBoxLayout" name="verticalLayout_4">
+       <property name="spacing">
+        <number>3</number>
        </property>
-       <layout class="QVBoxLayout" name="WMarkerLayout">
-        <property name="spacing">
-         <number>2</number>
-        </property>
-        <item>
-         <layout class="QHBoxLayout" name="WMarkerPosLayout">
-          <item>
-           <widget class="QLabel" name="wMarkerFrequencyLabel">
-            <property name="text">
-             <string>F</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="ValueDialZ" name="wMarkerFrequency" native="true">
-            <property name="sizePolicy">
-             <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
-              <horstretch>0</horstretch>
-              <verstretch>0</verstretch>
-             </sizepolicy>
-            </property>
-            <property name="minimumSize">
-             <size>
-              <width>32</width>
-              <height>16</height>
-             </size>
-            </property>
-            <property name="font">
-             <font>
-              <family>DejaVu Sans Mono</family>
-              <pointsize>12</pointsize>
-             </font>
-            </property>
-            <property name="cursor">
-             <cursorShape>PointingHandCursor</cursorShape>
-            </property>
-            <property name="focusPolicy">
-             <enum>Qt::StrongFocus</enum>
-            </property>
-            <property name="toolTip">
-             <string>Marker frequency (Hz)</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QLabel" name="wMarkerFrequencyUnits">
-            <property name="sizePolicy">
-             <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
-              <horstretch>0</horstretch>
-              <verstretch>0</verstretch>
-             </sizepolicy>
-            </property>
-            <property name="minimumSize">
-             <size>
-              <width>32</width>
-              <height>16</height>
-             </size>
-            </property>
-            <property name="cursor">
-             <cursorShape>PointingHandCursor</cursorShape>
-            </property>
-            <property name="focusPolicy">
-             <enum>Qt::StrongFocus</enum>
-            </property>
-            <property name="toolTip">
-             <string>Marker frequency (Hz)</string>
-            </property>
-            <property name="text">
-             <string>Hz</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <spacer name="horizontalSpacer_3">
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-          <item>
-           <widget class="QPushButton" name="wCenterFrequency">
-            <property name="maximumSize">
-             <size>
-              <width>24</width>
-              <height>24</height>
-             </size>
-            </property>
-            <property name="toolTip">
-             <string>Set marker as reference (index 0)</string>
-            </property>
-            <property name="text">
-             <string>C</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="ClickableLabel" name="wMarkerColor">
-            <property name="minimumSize">
-             <size>
-              <width>16</width>
-              <height>16</height>
-             </size>
-            </property>
-            <property name="maximumSize">
-             <size>
-              <width>16</width>
-              <height>16</height>
-             </size>
-            </property>
-            <property name="toolTip">
-             <string>Current marker color (click to change)</string>
-            </property>
-            <property name="text">
-             <string/>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QCheckBox" name="wShowMarker">
-            <property name="toolTip">
-             <string>Show this marker</string>
-            </property>
-            <property name="text">
-             <string/>
-            </property>
-            <property name="checked">
-             <bool>true</bool>
-            </property>
-           </widget>
-          </item>
-         </layout>
-        </item>
-        <item>
-         <layout class="QHBoxLayout" name="WMarkerOptionsLayout">
-          <item>
-           <widget class="QLabel" name="wMarkerLabel">
-            <property name="minimumSize">
-             <size>
-              <width>24</width>
-              <height>0</height>
-             </size>
-            </property>
-            <property name="text">
-             <string>Mk</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QLabel" name="wMarkerText">
-            <property name="minimumSize">
-             <size>
-              <width>15</width>
-              <height>0</height>
-             </size>
-            </property>
-            <property name="text">
-             <string>0</string>
-            </property>
-            <property name="alignment">
-             <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QDial" name="wMarker">
-            <property name="maximumSize">
-             <size>
-              <width>24</width>
-              <height>24</height>
-             </size>
-            </property>
-            <property name="toolTip">
-             <string>Marker index (0 is reference)</string>
-            </property>
-            <property name="maximum">
-             <number>0</number>
-            </property>
-            <property name="pageStep">
-             <number>1</number>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QPushButton" name="wSetReference">
-            <property name="maximumSize">
-             <size>
-              <width>24</width>
-              <height>24</height>
-             </size>
-            </property>
-            <property name="toolTip">
-             <string>Set marker as reference (index 0)</string>
-            </property>
-            <property name="text">
-             <string>0</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <layout class="QVBoxLayout" name="wMarkerAddRemoveLayout">
-            <property name="spacing">
-             <number>0</number>
-            </property>
-            <item>
-             <widget class="QPushButton" name="wMarkerAdd">
-              <property name="maximumSize">
-               <size>
-                <width>18</width>
-                <height>18</height>
-               </size>
-              </property>
-              <property name="palette">
-               <palette>
-                <active>
-                 <colorrole role="ButtonText">
-                  <brush brushstyle="SolidPattern">
-                   <color alpha="255">
-                    <red>255</red>
-                    <green>255</green>
-                    <blue>255</blue>
-                   </color>
-                  </brush>
-                 </colorrole>
-                </active>
-                <inactive>
-                 <colorrole role="ButtonText">
-                  <brush brushstyle="SolidPattern">
-                   <color alpha="255">
-                    <red>255</red>
-                    <green>255</green>
-                    <blue>255</blue>
-                   </color>
-                  </brush>
-                 </colorrole>
-                </inactive>
-                <disabled>
-                 <colorrole role="ButtonText">
-                  <brush brushstyle="SolidPattern">
-                   <color alpha="255">
-                    <red>190</red>
-                    <green>190</green>
-                    <blue>190</blue>
-                   </color>
-                  </brush>
-                 </colorrole>
-                </disabled>
-               </palette>
-              </property>
-              <property name="font">
-               <font>
-                <family>Liberation Sans</family>
-                <pointsize>10</pointsize>
-               </font>
-              </property>
-              <property name="toolTip">
-               <string>Add a new marker</string>
-              </property>
-              <property name="text">
-               <string>+</string>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <widget class="QPushButton" name="wMarkerDel">
-              <property name="maximumSize">
-               <size>
-                <width>18</width>
-                <height>18</height>
-               </size>
-              </property>
-              <property name="palette">
-               <palette>
-                <active>
-                 <colorrole role="ButtonText">
-                  <brush brushstyle="SolidPattern">
-                   <color alpha="255">
-                    <red>255</red>
-                    <green>255</green>
-                    <blue>255</blue>
-                   </color>
-                  </brush>
-                 </colorrole>
-                </active>
-                <inactive>
-                 <colorrole role="ButtonText">
-                  <brush brushstyle="SolidPattern">
-                   <color alpha="255">
-                    <red>255</red>
-                    <green>255</green>
-                    <blue>255</blue>
-                   </color>
-                  </brush>
-                 </colorrole>
-                </inactive>
-                <disabled>
-                 <colorrole role="ButtonText">
-                  <brush brushstyle="SolidPattern">
-                   <color alpha="255">
-                    <red>190</red>
-                    <green>190</green>
-                    <blue>190</blue>
-                   </color>
-                  </brush>
-                 </colorrole>
-                </disabled>
-               </palette>
-              </property>
-              <property name="font">
-               <font>
-                <family>Liberation Sans</family>
-                <pointsize>10</pointsize>
-               </font>
-              </property>
-              <property name="toolTip">
-               <string>Remove current marker</string>
-              </property>
-              <property name="text">
-               <string>-</string>
-              </property>
-             </widget>
-            </item>
-           </layout>
-          </item>
-          <item>
-           <widget class="QLabel" name="timeLabel">
-            <property name="minimumSize">
-             <size>
-              <width>20</width>
-              <height>0</height>
-             </size>
-            </property>
-            <property name="text">
-             <string>t(s)</string>
-            </property>
-            <property name="alignment">
-             <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <layout class="QVBoxLayout" name="timeLayout">
-            <property name="spacing">
-             <number>2</number>
-            </property>
-            <item>
-             <layout class="QHBoxLayout" name="timeMantissaLayout">
-              <item>
-               <widget class="QLabel" name="timeText">
-                <property name="minimumSize">
-                 <size>
-                  <width>36</width>
-                  <height>0</height>
-                 </size>
-                </property>
-                <property name="toolTip">
-                 <string>Time mantissa</string>
-                </property>
-                <property name="text">
-                 <string>0.000</string>
-                </property>
-                <property name="alignment">
-                 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-                </property>
-               </widget>
-              </item>
-              <item>
-               <widget class="QSlider" name="timeFine">
-                <property name="maximumSize">
-                 <size>
-                  <width>16777215</width>
-                  <height>14</height>
-                 </size>
-                </property>
-                <property name="toolTip">
-                 <string>Time mantissa (fine)</string>
-                </property>
-                <property name="minimum">
-                 <number>0</number>
-                </property>
-                <property name="maximum">
-                 <number>1000</number>
-                </property>
-                <property name="pageStep">
-                 <number>1</number>
-                </property>
-                <property name="orientation">
-                 <enum>Qt::Horizontal</enum>
-                </property>
-               </widget>
-              </item>
-              <item>
-               <widget class="QDial" name="timeCoarse">
-                <property name="maximumSize">
-                 <size>
-                  <width>24</width>
-                  <height>24</height>
-                 </size>
-                </property>
-                <property name="toolTip">
-                 <string>Time mantissa (coarse)</string>
-                </property>
-                <property name="minimum">
-                 <number>0</number>
-                </property>
-                <property name="maximum">
-                 <number>9</number>
-                </property>
-                <property name="pageStep">
-                 <number>1</number>
-                </property>
-                <property name="value">
-                 <number>0</number>
-                </property>
-               </widget>
-              </item>
-             </layout>
-            </item>
-            <item>
-             <layout class="QHBoxLayout" name="timeExponentLayout">
-              <property name="leftMargin">
-               <number>6</number>
-              </property>
-              <property name="topMargin">
-               <number>6</number>
-              </property>
-              <property name="rightMargin">
-               <number>6</number>
-              </property>
-              <property name="bottomMargin">
-               <number>6</number>
-              </property>
-              <item>
-               <widget class="QLabel" name="timeExpText">
-                <property name="minimumSize">
-                 <size>
-                  <width>36</width>
-                  <height>0</height>
-                 </size>
-                </property>
-                <property name="toolTip">
-                 <string>Time exponent</string>
-                </property>
-                <property name="text">
-                 <string>e+0</string>
-                </property>
-                <property name="alignment">
-                 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-                </property>
-               </widget>
-              </item>
-              <item>
-               <widget class="QSlider" name="timeExp">
-                <property name="maximumSize">
-                 <size>
-                  <width>16777215</width>
-                  <height>14</height>
-                 </size>
-                </property>
-                <property name="toolTip">
-                 <string>Time exponent</string>
-                </property>
-                <property name="minimum">
-                 <number>-10</number>
-                </property>
-                <property name="maximum">
-                 <number>10</number>
-                </property>
-                <property name="pageStep">
-                 <number>1</number>
-                </property>
-                <property name="orientation">
-                 <enum>Qt::Horizontal</enum>
-                </property>
-               </widget>
-              </item>
-             </layout>
-            </item>
-           </layout>
-          </item>
-          <item>
-           <spacer name="horizontalSpacer_4">
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-         </layout>
-        </item>
-       </layout>
-      </widget>
+       <property name="leftMargin">
+        <number>3</number>
+       </property>
+       <property name="topMargin">
+        <number>3</number>
+       </property>
+       <property name="rightMargin">
+        <number>3</number>
+       </property>
+       <property name="bottomMargin">
+        <number>3</number>
+       </property>
+       <item>
+        <layout class="QHBoxLayout" name="WMarkerPosLayout">
+         <item>
+          <widget class="QLabel" name="wMarkerFrequencyLabel">
+           <property name="text">
+            <string>F</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="ValueDialZ" name="wMarkerFrequency" native="true">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="minimumSize">
+            <size>
+             <width>32</width>
+             <height>16</height>
+            </size>
+           </property>
+           <property name="font">
+            <font>
+             <family>DejaVu Sans Mono</family>
+             <pointsize>12</pointsize>
+            </font>
+           </property>
+           <property name="cursor">
+            <cursorShape>PointingHandCursor</cursorShape>
+           </property>
+           <property name="focusPolicy">
+            <enum>Qt::StrongFocus</enum>
+           </property>
+           <property name="toolTip">
+            <string>Marker frequency (Hz)</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLabel" name="wMarkerFrequencyUnits">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="minimumSize">
+            <size>
+             <width>32</width>
+             <height>16</height>
+            </size>
+           </property>
+           <property name="cursor">
+            <cursorShape>PointingHandCursor</cursorShape>
+           </property>
+           <property name="focusPolicy">
+            <enum>Qt::StrongFocus</enum>
+           </property>
+           <property name="toolTip">
+            <string>Marker frequency (Hz)</string>
+           </property>
+           <property name="text">
+            <string>Hz</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer name="horizontalSpacer_3">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="QPushButton" name="wCenterFrequency">
+           <property name="maximumSize">
+            <size>
+             <width>24</width>
+             <height>24</height>
+            </size>
+           </property>
+           <property name="toolTip">
+            <string>Set marker as reference (index 0)</string>
+           </property>
+           <property name="text">
+            <string>C</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="ClickableLabel" name="wMarkerColor">
+           <property name="minimumSize">
+            <size>
+             <width>16</width>
+             <height>16</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>16</width>
+             <height>16</height>
+            </size>
+           </property>
+           <property name="toolTip">
+            <string>Current marker color (click to change)</string>
+           </property>
+           <property name="text">
+            <string/>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QCheckBox" name="wShowMarker">
+           <property name="toolTip">
+            <string>Show this marker</string>
+           </property>
+           <property name="text">
+            <string/>
+           </property>
+           <property name="checked">
+            <bool>true</bool>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="WMarkerOptionsLayout">
+         <item>
+          <widget class="QLabel" name="wMarkerLabel">
+           <property name="minimumSize">
+            <size>
+             <width>24</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="text">
+            <string>Mk</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLabel" name="wMarkerText">
+           <property name="minimumSize">
+            <size>
+             <width>15</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="text">
+            <string>0</string>
+           </property>
+           <property name="alignment">
+            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QDial" name="wMarker">
+           <property name="maximumSize">
+            <size>
+             <width>24</width>
+             <height>24</height>
+            </size>
+           </property>
+           <property name="toolTip">
+            <string>Marker index (0 is reference)</string>
+           </property>
+           <property name="maximum">
+            <number>0</number>
+           </property>
+           <property name="pageStep">
+            <number>1</number>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QPushButton" name="wSetReference">
+           <property name="maximumSize">
+            <size>
+             <width>24</width>
+             <height>24</height>
+            </size>
+           </property>
+           <property name="toolTip">
+            <string>Set marker as reference (index 0)</string>
+           </property>
+           <property name="text">
+            <string>0</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <layout class="QVBoxLayout" name="wMarkerAddRemoveLayout">
+           <property name="spacing">
+            <number>0</number>
+           </property>
+           <item>
+            <widget class="QPushButton" name="wMarkerAdd">
+             <property name="maximumSize">
+              <size>
+               <width>18</width>
+               <height>18</height>
+              </size>
+             </property>
+             <property name="palette">
+              <palette>
+               <active>
+                <colorrole role="ButtonText">
+                 <brush brushstyle="SolidPattern">
+                  <color alpha="255">
+                   <red>255</red>
+                   <green>255</green>
+                   <blue>255</blue>
+                  </color>
+                 </brush>
+                </colorrole>
+               </active>
+               <inactive>
+                <colorrole role="ButtonText">
+                 <brush brushstyle="SolidPattern">
+                  <color alpha="255">
+                   <red>255</red>
+                   <green>255</green>
+                   <blue>255</blue>
+                  </color>
+                 </brush>
+                </colorrole>
+               </inactive>
+               <disabled>
+                <colorrole role="ButtonText">
+                 <brush brushstyle="SolidPattern">
+                  <color alpha="255">
+                   <red>190</red>
+                   <green>190</green>
+                   <blue>190</blue>
+                  </color>
+                 </brush>
+                </colorrole>
+               </disabled>
+              </palette>
+             </property>
+             <property name="font">
+              <font>
+               <family>Liberation Sans</family>
+               <pointsize>10</pointsize>
+              </font>
+             </property>
+             <property name="toolTip">
+              <string>Add a new marker</string>
+             </property>
+             <property name="text">
+              <string>+</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QPushButton" name="wMarkerDel">
+             <property name="maximumSize">
+              <size>
+               <width>18</width>
+               <height>18</height>
+              </size>
+             </property>
+             <property name="palette">
+              <palette>
+               <active>
+                <colorrole role="ButtonText">
+                 <brush brushstyle="SolidPattern">
+                  <color alpha="255">
+                   <red>255</red>
+                   <green>255</green>
+                   <blue>255</blue>
+                  </color>
+                 </brush>
+                </colorrole>
+               </active>
+               <inactive>
+                <colorrole role="ButtonText">
+                 <brush brushstyle="SolidPattern">
+                  <color alpha="255">
+                   <red>255</red>
+                   <green>255</green>
+                   <blue>255</blue>
+                  </color>
+                 </brush>
+                </colorrole>
+               </inactive>
+               <disabled>
+                <colorrole role="ButtonText">
+                 <brush brushstyle="SolidPattern">
+                  <color alpha="255">
+                   <red>190</red>
+                   <green>190</green>
+                   <blue>190</blue>
+                  </color>
+                 </brush>
+                </colorrole>
+               </disabled>
+              </palette>
+             </property>
+             <property name="font">
+              <font>
+               <family>Liberation Sans</family>
+               <pointsize>10</pointsize>
+              </font>
+             </property>
+             <property name="toolTip">
+              <string>Remove current marker</string>
+             </property>
+             <property name="text">
+              <string>-</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <widget class="QLabel" name="timeLabel">
+           <property name="minimumSize">
+            <size>
+             <width>20</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="text">
+            <string>t(s)</string>
+           </property>
+           <property name="alignment">
+            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <layout class="QVBoxLayout" name="timeLayout">
+           <property name="spacing">
+            <number>2</number>
+           </property>
+           <item>
+            <layout class="QHBoxLayout" name="timeMantissaLayout">
+             <item>
+              <widget class="QLabel" name="timeText">
+               <property name="minimumSize">
+                <size>
+                 <width>36</width>
+                 <height>0</height>
+                </size>
+               </property>
+               <property name="toolTip">
+                <string>Time mantissa</string>
+               </property>
+               <property name="text">
+                <string>0.000</string>
+               </property>
+               <property name="alignment">
+                <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QSlider" name="timeFine">
+               <property name="maximumSize">
+                <size>
+                 <width>16777215</width>
+                 <height>14</height>
+                </size>
+               </property>
+               <property name="toolTip">
+                <string>Time mantissa (fine)</string>
+               </property>
+               <property name="minimum">
+                <number>0</number>
+               </property>
+               <property name="maximum">
+                <number>1000</number>
+               </property>
+               <property name="pageStep">
+                <number>1</number>
+               </property>
+               <property name="orientation">
+                <enum>Qt::Horizontal</enum>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QDial" name="timeCoarse">
+               <property name="maximumSize">
+                <size>
+                 <width>24</width>
+                 <height>24</height>
+                </size>
+               </property>
+               <property name="toolTip">
+                <string>Time mantissa (coarse)</string>
+               </property>
+               <property name="minimum">
+                <number>0</number>
+               </property>
+               <property name="maximum">
+                <number>9</number>
+               </property>
+               <property name="pageStep">
+                <number>1</number>
+               </property>
+               <property name="value">
+                <number>0</number>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+           <item>
+            <layout class="QHBoxLayout" name="timeExponentLayout">
+             <property name="leftMargin">
+              <number>6</number>
+             </property>
+             <property name="topMargin">
+              <number>6</number>
+             </property>
+             <property name="rightMargin">
+              <number>6</number>
+             </property>
+             <property name="bottomMargin">
+              <number>6</number>
+             </property>
+             <item>
+              <widget class="QLabel" name="timeExpText">
+               <property name="minimumSize">
+                <size>
+                 <width>36</width>
+                 <height>0</height>
+                </size>
+               </property>
+               <property name="toolTip">
+                <string>Time exponent</string>
+               </property>
+               <property name="text">
+                <string>e+0</string>
+               </property>
+               <property name="alignment">
+                <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QSlider" name="timeExp">
+               <property name="maximumSize">
+                <size>
+                 <width>16777215</width>
+                 <height>14</height>
+                </size>
+               </property>
+               <property name="toolTip">
+                <string>Time exponent</string>
+               </property>
+               <property name="minimum">
+                <number>-10</number>
+               </property>
+               <property name="maximum">
+                <number>10</number>
+               </property>
+               <property name="pageStep">
+                <number>1</number>
+               </property>
+               <property name="orientation">
+                <enum>Qt::Horizontal</enum>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <spacer name="horizontalSpacer_4">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <spacer name="verticalSpacer_2">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>40</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
      </widget>
      <widget class="QWidget" name="anoTab">
       <attribute name="title">
@@ -1049,690 +1085,711 @@ Max - Marker will move according to the maximum power at the marker frequency</s
       <attribute name="toolTip">
        <string>Annotation markers</string>
       </attribute>
-      <widget class="QWidget" name="layoutWidget_2">
-       <property name="geometry">
-        <rect>
-         <x>0</x>
-         <y>0</y>
-         <width>451</width>
-         <height>151</height>
-        </rect>
+      <layout class="QVBoxLayout" name="verticalLayout_3">
+       <property name="spacing">
+        <number>3</number>
        </property>
-       <layout class="QVBoxLayout" name="AMarkerLayout">
-        <property name="spacing">
-         <number>2</number>
-        </property>
-        <item>
-         <layout class="QHBoxLayout" name="AMarkerGeneralLayout">
-          <item>
-           <widget class="QLabel" name="aMarkerLabel">
-            <property name="minimumSize">
-             <size>
-              <width>24</width>
-              <height>0</height>
-             </size>
-            </property>
-            <property name="text">
-             <string>Mk</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QLabel" name="aMarkerIndexText">
-            <property name="minimumSize">
-             <size>
-              <width>30</width>
-              <height>0</height>
-             </size>
-            </property>
-            <property name="toolTip">
-             <string>Marker index</string>
-            </property>
-            <property name="text">
-             <string>0</string>
-            </property>
-            <property name="alignment">
-             <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QDial" name="aMarker">
-            <property name="maximumSize">
-             <size>
-              <width>24</width>
-              <height>24</height>
-             </size>
-            </property>
-            <property name="toolTip">
-             <string>Marker index selection</string>
-            </property>
-            <property name="maximum">
-             <number>0</number>
-            </property>
-            <property name="pageStep">
-             <number>1</number>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <layout class="QVBoxLayout" name="AMarkerAddRemoveLayout">
-            <property name="spacing">
-             <number>0</number>
-            </property>
-            <item>
-             <widget class="QPushButton" name="aMarkerAdd">
-              <property name="maximumSize">
-               <size>
-                <width>18</width>
-                <height>18</height>
-               </size>
-              </property>
-              <property name="palette">
-               <palette>
-                <active>
-                 <colorrole role="ButtonText">
-                  <brush brushstyle="SolidPattern">
-                   <color alpha="255">
-                    <red>255</red>
-                    <green>255</green>
-                    <blue>255</blue>
-                   </color>
-                  </brush>
-                 </colorrole>
-                </active>
-                <inactive>
-                 <colorrole role="ButtonText">
-                  <brush brushstyle="SolidPattern">
-                   <color alpha="255">
-                    <red>255</red>
-                    <green>255</green>
-                    <blue>255</blue>
-                   </color>
-                  </brush>
-                 </colorrole>
-                </inactive>
-                <disabled>
-                 <colorrole role="ButtonText">
-                  <brush brushstyle="SolidPattern">
-                   <color alpha="255">
-                    <red>190</red>
-                    <green>190</green>
-                    <blue>190</blue>
-                   </color>
-                  </brush>
-                 </colorrole>
-                </disabled>
-               </palette>
-              </property>
-              <property name="font">
-               <font>
-                <family>Liberation Sans</family>
-                <pointsize>10</pointsize>
-               </font>
-              </property>
-              <property name="toolTip">
-               <string>Add a new marker</string>
-              </property>
-              <property name="text">
-               <string>+</string>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <widget class="QPushButton" name="aMarkerDel">
-              <property name="maximumSize">
-               <size>
-                <width>18</width>
-                <height>18</height>
-               </size>
-              </property>
-              <property name="palette">
-               <palette>
-                <active>
-                 <colorrole role="ButtonText">
-                  <brush brushstyle="SolidPattern">
-                   <color alpha="255">
-                    <red>255</red>
-                    <green>255</green>
-                    <blue>255</blue>
-                   </color>
-                  </brush>
-                 </colorrole>
-                </active>
-                <inactive>
-                 <colorrole role="ButtonText">
-                  <brush brushstyle="SolidPattern">
-                   <color alpha="255">
-                    <red>255</red>
-                    <green>255</green>
-                    <blue>255</blue>
-                   </color>
-                  </brush>
-                 </colorrole>
-                </inactive>
-                <disabled>
-                 <colorrole role="ButtonText">
-                  <brush brushstyle="SolidPattern">
-                   <color alpha="255">
-                    <red>190</red>
-                    <green>190</green>
-                    <blue>190</blue>
-                   </color>
-                  </brush>
-                 </colorrole>
-                </disabled>
-               </palette>
-              </property>
-              <property name="font">
-               <font>
-                <family>Liberation Sans</family>
-                <pointsize>10</pointsize>
-               </font>
-              </property>
-              <property name="toolTip">
-               <string>Remove current marker</string>
-              </property>
-              <property name="text">
-               <string>-</string>
-              </property>
-             </widget>
-            </item>
-           </layout>
-          </item>
-          <item>
-           <widget class="ClickableLabel" name="aMarkerColor">
-            <property name="minimumSize">
-             <size>
-              <width>16</width>
-              <height>16</height>
-             </size>
-            </property>
-            <property name="maximumSize">
-             <size>
-              <width>16</width>
-              <height>16</height>
-             </size>
-            </property>
-            <property name="toolTip">
-             <string>Current marker color (click to change)</string>
-            </property>
-            <property name="text">
-             <string/>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QLineEdit" name="aMarkerText">
-            <property name="toolTip">
-             <string>Marker text</string>
-            </property>
-            <property name="maxLength">
-             <number>36</number>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QToolButton" name="aMarkersExport">
-            <property name="toolTip">
-             <string>Export annotation marks to .csv file</string>
-            </property>
-            <property name="text">
-             <string/>
-            </property>
-            <property name="icon">
-             <iconset resource="../resources/res.qrc">
-              <normaloff>:/export.png</normaloff>:/export.png</iconset>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QToolButton" name="aMarkersImport">
-            <property name="toolTip">
-             <string>Import annotation marks from .csv file</string>
-            </property>
-            <property name="text">
-             <string/>
-            </property>
-            <property name="icon">
-             <iconset resource="../resources/res.qrc">
-              <normaloff>:/import.png</normaloff>:/import.png</iconset>
-            </property>
-           </widget>
-          </item>
-         </layout>
-        </item>
-        <item>
-         <layout class="QHBoxLayout" name="AMarkerStartLayout">
-          <item>
-           <widget class="QToolButton" name="aMarkerToggleFrequency">
-            <property name="text">
-             <string>Start</string>
-            </property>
-            <property name="checkable">
-             <bool>true</bool>
-            </property>
-            <property name="autoRaise">
-             <bool>false</bool>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="ValueDialZ" name="aMarkerFrequency" native="true">
-            <property name="sizePolicy">
-             <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
-              <horstretch>0</horstretch>
-              <verstretch>0</verstretch>
-             </sizepolicy>
-            </property>
-            <property name="minimumSize">
-             <size>
-              <width>32</width>
-              <height>16</height>
-             </size>
-            </property>
-            <property name="font">
-             <font>
-              <family>DejaVu Sans Mono</family>
-              <pointsize>12</pointsize>
-             </font>
-            </property>
-            <property name="cursor">
-             <cursorShape>PointingHandCursor</cursorShape>
-            </property>
-            <property name="focusPolicy">
-             <enum>Qt::StrongFocus</enum>
-            </property>
-            <property name="toolTip">
-             <string>Marker start frequency (Hz)</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QLabel" name="aMarkerFrequencyUnits">
-            <property name="sizePolicy">
-             <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
-              <horstretch>0</horstretch>
-              <verstretch>0</verstretch>
-             </sizepolicy>
-            </property>
-            <property name="minimumSize">
-             <size>
-              <width>32</width>
-              <height>16</height>
-             </size>
-            </property>
-            <property name="cursor">
-             <cursorShape>PointingHandCursor</cursorShape>
-            </property>
-            <property name="focusPolicy">
-             <enum>Qt::StrongFocus</enum>
-            </property>
-            <property name="toolTip">
-             <string>Marker frequency (Hz)</string>
-            </property>
-            <property name="text">
-             <string>Hz</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QPushButton" name="aCenterFrequency">
-            <property name="maximumSize">
-             <size>
-              <width>24</width>
-              <height>24</height>
-             </size>
-            </property>
-            <property name="toolTip">
-             <string>Set marker frequency to center frequency</string>
-            </property>
-            <property name="text">
-             <string>C</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QPushButton" name="aMakerDuplicate">
-            <property name="maximumSize">
-             <size>
-              <width>24</width>
-              <height>24</height>
-             </size>
-            </property>
-            <property name="toolTip">
-             <string>Duplicate current marker</string>
-            </property>
-            <property name="text">
-             <string/>
-            </property>
-            <property name="icon">
-             <iconset resource="../resources/res.qrc">
-              <normaloff>:/duplicate.png</normaloff>:/duplicate.png</iconset>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QPushButton" name="aMakersSort">
-            <property name="maximumSize">
-             <size>
-              <width>24</width>
-              <height>24</height>
-             </size>
-            </property>
-            <property name="toolTip">
-             <string>Sort markers by increasing start frequency</string>
-            </property>
-            <property name="text">
-             <string/>
-            </property>
-            <property name="icon">
-             <iconset resource="../resources/res.qrc">
-              <normaloff>:/sort.png</normaloff>:/sort.png</iconset>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <spacer name="horizontalSpacer_8">
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-         </layout>
-        </item>
-        <item>
-         <layout class="QHBoxLayout" name="AMarkeStopLayout">
-          <item>
-           <widget class="QLabel" name="aMarkerFreqLabel">
-            <property name="minimumSize">
-             <size>
-              <width>30</width>
-              <height>0</height>
-             </size>
-            </property>
-            <property name="text">
-             <string>Cent</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QLabel" name="aMarkerFreqText">
-            <property name="minimumSize">
-             <size>
-              <width>140</width>
-              <height>0</height>
-             </size>
-            </property>
-            <property name="font">
-             <font>
-              <family>DejaVu Sans Mono</family>
-              <pointsize>12</pointsize>
-             </font>
-            </property>
-            <property name="toolTip">
-             <string>Marker stop frequency (Hz)</string>
-            </property>
-            <property name="text">
-             <string>0,000,000,000</string>
-            </property>
-            <property name="alignment">
-             <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QLabel" name="aMarkerFreqFrequencyUnits">
-            <property name="sizePolicy">
-             <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
-              <horstretch>0</horstretch>
-              <verstretch>0</verstretch>
-             </sizepolicy>
-            </property>
-            <property name="minimumSize">
-             <size>
-              <width>32</width>
-              <height>16</height>
-             </size>
-            </property>
-            <property name="cursor">
-             <cursorShape>PointingHandCursor</cursorShape>
-            </property>
-            <property name="focusPolicy">
-             <enum>Qt::StrongFocus</enum>
-            </property>
-            <property name="toolTip">
-             <string>Marker frequency (Hz)</string>
-            </property>
-            <property name="text">
-             <string>Hz</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <spacer name="horizontalSpacer_9">
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-          <item>
-           <widget class="QLabel" name="aMarkerStopLabel">
-            <property name="minimumSize">
-             <size>
-              <width>30</width>
-              <height>0</height>
-             </size>
-            </property>
-            <property name="text">
-             <string>Stop</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QLabel" name="aMarkerStopText">
-            <property name="minimumSize">
-             <size>
-              <width>140</width>
-              <height>0</height>
-             </size>
-            </property>
-            <property name="font">
-             <font>
-              <family>DejaVu Sans Mono</family>
-              <pointsize>12</pointsize>
-             </font>
-            </property>
-            <property name="toolTip">
-             <string>Marker stop frequency (Hz)</string>
-            </property>
-            <property name="text">
-             <string>0,000,000,000</string>
-            </property>
-            <property name="alignment">
-             <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QLabel" name="aMarkerStopFrequencyUnits">
-            <property name="sizePolicy">
-             <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
-              <horstretch>0</horstretch>
-              <verstretch>0</verstretch>
-             </sizepolicy>
-            </property>
-            <property name="minimumSize">
-             <size>
-              <width>32</width>
-              <height>16</height>
-             </size>
-            </property>
-            <property name="cursor">
-             <cursorShape>PointingHandCursor</cursorShape>
-            </property>
-            <property name="focusPolicy">
-             <enum>Qt::StrongFocus</enum>
-            </property>
-            <property name="toolTip">
-             <string>Marker frequency (Hz)</string>
-            </property>
-            <property name="text">
-             <string>Hz</string>
-            </property>
-           </widget>
-          </item>
-         </layout>
-        </item>
-        <item>
-         <layout class="QHBoxLayout" name="AMarkerOptionsLayout">
-          <item>
-           <widget class="QLabel" name="aBandwidthLabel">
-            <property name="minimumSize">
-             <size>
-              <width>15</width>
-              <height>0</height>
-             </size>
-            </property>
-            <property name="text">
-             <string>BW</string>
-            </property>
-            <property name="alignment">
-             <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="ValueDialZ" name="aMarkerBandwidth" native="true">
-            <property name="sizePolicy">
-             <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
-              <horstretch>0</horstretch>
-              <verstretch>0</verstretch>
-             </sizepolicy>
-            </property>
-            <property name="minimumSize">
-             <size>
-              <width>32</width>
-              <height>16</height>
-             </size>
-            </property>
-            <property name="font">
-             <font>
-              <family>DejaVu Sans Mono</family>
-              <pointsize>12</pointsize>
-             </font>
-            </property>
-            <property name="cursor">
-             <cursorShape>PointingHandCursor</cursorShape>
-            </property>
-            <property name="focusPolicy">
-             <enum>Qt::StrongFocus</enum>
-            </property>
-            <property name="toolTip">
-             <string>Marker width (Hz)</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QLabel" name="aMarkerBandwidthUnits">
-            <property name="sizePolicy">
-             <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
-              <horstretch>0</horstretch>
-              <verstretch>0</verstretch>
-             </sizepolicy>
-            </property>
-            <property name="minimumSize">
-             <size>
-              <width>32</width>
-              <height>16</height>
-             </size>
-            </property>
-            <property name="cursor">
-             <cursorShape>PointingHandCursor</cursorShape>
-            </property>
-            <property name="focusPolicy">
-             <enum>Qt::StrongFocus</enum>
-            </property>
-            <property name="toolTip">
-             <string>Marker frequency (Hz)</string>
-            </property>
-            <property name="text">
-             <string>Hz</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QComboBox" name="aMarkerShowState">
-            <property name="toolTip">
-             <string>Marker show state</string>
-            </property>
-            <item>
-             <property name="text">
-              <string>Hidden</string>
+       <property name="leftMargin">
+        <number>3</number>
+       </property>
+       <property name="topMargin">
+        <number>3</number>
+       </property>
+       <property name="rightMargin">
+        <number>3</number>
+       </property>
+       <property name="bottomMargin">
+        <number>3</number>
+       </property>
+       <item>
+        <layout class="QHBoxLayout" name="AMarkerGeneralLayout">
+         <item>
+          <widget class="QLabel" name="aMarkerLabel">
+           <property name="minimumSize">
+            <size>
+             <width>24</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="text">
+            <string>Mk</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLabel" name="aMarkerIndexText">
+           <property name="minimumSize">
+            <size>
+             <width>30</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="toolTip">
+            <string>Marker index</string>
+           </property>
+           <property name="text">
+            <string>0</string>
+           </property>
+           <property name="alignment">
+            <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QDial" name="aMarker">
+           <property name="maximumSize">
+            <size>
+             <width>24</width>
+             <height>24</height>
+            </size>
+           </property>
+           <property name="toolTip">
+            <string>Marker index selection</string>
+           </property>
+           <property name="maximum">
+            <number>0</number>
+           </property>
+           <property name="pageStep">
+            <number>1</number>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <layout class="QVBoxLayout" name="AMarkerAddRemoveLayout">
+           <property name="spacing">
+            <number>0</number>
+           </property>
+           <item>
+            <widget class="QPushButton" name="aMarkerAdd">
+             <property name="maximumSize">
+              <size>
+               <width>18</width>
+               <height>18</height>
+              </size>
              </property>
-            </item>
-            <item>
-             <property name="text">
-              <string>Top</string>
+             <property name="palette">
+              <palette>
+               <active>
+                <colorrole role="ButtonText">
+                 <brush brushstyle="SolidPattern">
+                  <color alpha="255">
+                   <red>255</red>
+                   <green>255</green>
+                   <blue>255</blue>
+                  </color>
+                 </brush>
+                </colorrole>
+               </active>
+               <inactive>
+                <colorrole role="ButtonText">
+                 <brush brushstyle="SolidPattern">
+                  <color alpha="255">
+                   <red>255</red>
+                   <green>255</green>
+                   <blue>255</blue>
+                  </color>
+                 </brush>
+                </colorrole>
+               </inactive>
+               <disabled>
+                <colorrole role="ButtonText">
+                 <brush brushstyle="SolidPattern">
+                  <color alpha="255">
+                   <red>190</red>
+                   <green>190</green>
+                   <blue>190</blue>
+                  </color>
+                 </brush>
+                </colorrole>
+               </disabled>
+              </palette>
              </property>
-            </item>
-            <item>
-             <property name="text">
-              <string>Full</string>
+             <property name="font">
+              <font>
+               <family>Liberation Sans</family>
+               <pointsize>10</pointsize>
+              </font>
              </property>
-            </item>
-            <item>
-             <property name="text">
-              <string>Text</string>
+             <property name="toolTip">
+              <string>Add a new marker</string>
              </property>
-            </item>
-           </widget>
-          </item>
-          <item>
-           <widget class="QPushButton" name="aMarkerShowStateAll">
-            <property name="maximumSize">
-             <size>
-              <width>30</width>
-              <height>16777215</height>
-             </size>
-            </property>
-            <property name="toolTip">
-             <string>Apply current show state to all markers</string>
-            </property>
+             <property name="text">
+              <string>+</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QPushButton" name="aMarkerDel">
+             <property name="maximumSize">
+              <size>
+               <width>18</width>
+               <height>18</height>
+              </size>
+             </property>
+             <property name="palette">
+              <palette>
+               <active>
+                <colorrole role="ButtonText">
+                 <brush brushstyle="SolidPattern">
+                  <color alpha="255">
+                   <red>255</red>
+                   <green>255</green>
+                   <blue>255</blue>
+                  </color>
+                 </brush>
+                </colorrole>
+               </active>
+               <inactive>
+                <colorrole role="ButtonText">
+                 <brush brushstyle="SolidPattern">
+                  <color alpha="255">
+                   <red>255</red>
+                   <green>255</green>
+                   <blue>255</blue>
+                  </color>
+                 </brush>
+                </colorrole>
+               </inactive>
+               <disabled>
+                <colorrole role="ButtonText">
+                 <brush brushstyle="SolidPattern">
+                  <color alpha="255">
+                   <red>190</red>
+                   <green>190</green>
+                   <blue>190</blue>
+                  </color>
+                 </brush>
+                </colorrole>
+               </disabled>
+              </palette>
+             </property>
+             <property name="font">
+              <font>
+               <family>Liberation Sans</family>
+               <pointsize>10</pointsize>
+              </font>
+             </property>
+             <property name="toolTip">
+              <string>Remove current marker</string>
+             </property>
+             <property name="text">
+              <string>-</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <widget class="ClickableLabel" name="aMarkerColor">
+           <property name="minimumSize">
+            <size>
+             <width>16</width>
+             <height>16</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>16</width>
+             <height>16</height>
+            </size>
+           </property>
+           <property name="toolTip">
+            <string>Current marker color (click to change)</string>
+           </property>
+           <property name="text">
+            <string/>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLineEdit" name="aMarkerText">
+           <property name="toolTip">
+            <string>Marker text</string>
+           </property>
+           <property name="maxLength">
+            <number>36</number>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QToolButton" name="aMarkersExport">
+           <property name="toolTip">
+            <string>Export annotation marks to .csv file</string>
+           </property>
+           <property name="text">
+            <string/>
+           </property>
+           <property name="icon">
+            <iconset resource="../resources/res.qrc">
+             <normaloff>:/export.png</normaloff>:/export.png</iconset>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QToolButton" name="aMarkersImport">
+           <property name="toolTip">
+            <string>Import annotation marks from .csv file</string>
+           </property>
+           <property name="text">
+            <string/>
+           </property>
+           <property name="icon">
+            <iconset resource="../resources/res.qrc">
+             <normaloff>:/import.png</normaloff>:/import.png</iconset>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="AMarkerStartLayout">
+         <item>
+          <widget class="QToolButton" name="aMarkerToggleFrequency">
+           <property name="text">
+            <string>Start</string>
+           </property>
+           <property name="checkable">
+            <bool>true</bool>
+           </property>
+           <property name="autoRaise">
+            <bool>false</bool>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="ValueDialZ" name="aMarkerFrequency" native="true">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="minimumSize">
+            <size>
+             <width>32</width>
+             <height>16</height>
+            </size>
+           </property>
+           <property name="font">
+            <font>
+             <family>DejaVu Sans Mono</family>
+             <pointsize>12</pointsize>
+            </font>
+           </property>
+           <property name="cursor">
+            <cursorShape>PointingHandCursor</cursorShape>
+           </property>
+           <property name="focusPolicy">
+            <enum>Qt::StrongFocus</enum>
+           </property>
+           <property name="toolTip">
+            <string>Marker start frequency (Hz)</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLabel" name="aMarkerFrequencyUnits">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="minimumSize">
+            <size>
+             <width>32</width>
+             <height>16</height>
+            </size>
+           </property>
+           <property name="cursor">
+            <cursorShape>PointingHandCursor</cursorShape>
+           </property>
+           <property name="focusPolicy">
+            <enum>Qt::StrongFocus</enum>
+           </property>
+           <property name="toolTip">
+            <string>Marker frequency (Hz)</string>
+           </property>
+           <property name="text">
+            <string>Hz</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QPushButton" name="aCenterFrequency">
+           <property name="maximumSize">
+            <size>
+             <width>24</width>
+             <height>24</height>
+            </size>
+           </property>
+           <property name="toolTip">
+            <string>Set marker frequency to center frequency</string>
+           </property>
+           <property name="text">
+            <string>C</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QPushButton" name="aMakerDuplicate">
+           <property name="maximumSize">
+            <size>
+             <width>24</width>
+             <height>24</height>
+            </size>
+           </property>
+           <property name="toolTip">
+            <string>Duplicate current marker</string>
+           </property>
+           <property name="text">
+            <string/>
+           </property>
+           <property name="icon">
+            <iconset resource="../resources/res.qrc">
+             <normaloff>:/duplicate.png</normaloff>:/duplicate.png</iconset>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QPushButton" name="aMakersSort">
+           <property name="maximumSize">
+            <size>
+             <width>24</width>
+             <height>24</height>
+            </size>
+           </property>
+           <property name="toolTip">
+            <string>Sort markers by increasing start frequency</string>
+           </property>
+           <property name="text">
+            <string/>
+           </property>
+           <property name="icon">
+            <iconset resource="../resources/res.qrc">
+             <normaloff>:/sort.png</normaloff>:/sort.png</iconset>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer name="horizontalSpacer_8">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="AMarkeStopLayout">
+         <item>
+          <widget class="QLabel" name="aMarkerFreqLabel">
+           <property name="minimumSize">
+            <size>
+             <width>30</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="text">
+            <string>Cent</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLabel" name="aMarkerFreqText">
+           <property name="minimumSize">
+            <size>
+             <width>100</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="font">
+            <font>
+             <family>DejaVu Sans Mono</family>
+             <pointsize>12</pointsize>
+            </font>
+           </property>
+           <property name="toolTip">
+            <string>Marker stop frequency (Hz)</string>
+           </property>
+           <property name="text">
+            <string>0,000,000,000</string>
+           </property>
+           <property name="alignment">
+            <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLabel" name="aMarkerFreqFrequencyUnits">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="minimumSize">
+            <size>
+             <width>32</width>
+             <height>16</height>
+            </size>
+           </property>
+           <property name="cursor">
+            <cursorShape>PointingHandCursor</cursorShape>
+           </property>
+           <property name="focusPolicy">
+            <enum>Qt::StrongFocus</enum>
+           </property>
+           <property name="toolTip">
+            <string>Marker frequency (Hz)</string>
+           </property>
+           <property name="text">
+            <string>Hz</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer name="horizontalSpacer_9">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="QLabel" name="aMarkerStopLabel">
+           <property name="minimumSize">
+            <size>
+             <width>30</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="text">
+            <string>Stop</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLabel" name="aMarkerStopText">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="minimumSize">
+            <size>
+             <width>100</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="font">
+            <font>
+             <family>DejaVu Sans Mono</family>
+             <pointsize>12</pointsize>
+            </font>
+           </property>
+           <property name="toolTip">
+            <string>Marker stop frequency (Hz)</string>
+           </property>
+           <property name="text">
+            <string>0,000,000,000</string>
+           </property>
+           <property name="alignment">
+            <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLabel" name="aMarkerStopFrequencyUnits">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="minimumSize">
+            <size>
+             <width>32</width>
+             <height>16</height>
+            </size>
+           </property>
+           <property name="cursor">
+            <cursorShape>PointingHandCursor</cursorShape>
+           </property>
+           <property name="focusPolicy">
+            <enum>Qt::StrongFocus</enum>
+           </property>
+           <property name="toolTip">
+            <string>Marker frequency (Hz)</string>
+           </property>
+           <property name="text">
+            <string>Hz</string>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="AMarkerOptionsLayout">
+         <item>
+          <widget class="QLabel" name="aBandwidthLabel">
+           <property name="minimumSize">
+            <size>
+             <width>15</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="text">
+            <string>BW</string>
+           </property>
+           <property name="alignment">
+            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="ValueDialZ" name="aMarkerBandwidth" native="true">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="minimumSize">
+            <size>
+             <width>32</width>
+             <height>16</height>
+            </size>
+           </property>
+           <property name="font">
+            <font>
+             <family>DejaVu Sans Mono</family>
+             <pointsize>12</pointsize>
+            </font>
+           </property>
+           <property name="cursor">
+            <cursorShape>PointingHandCursor</cursorShape>
+           </property>
+           <property name="focusPolicy">
+            <enum>Qt::StrongFocus</enum>
+           </property>
+           <property name="toolTip">
+            <string>Marker width (Hz)</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLabel" name="aMarkerBandwidthUnits">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="minimumSize">
+            <size>
+             <width>32</width>
+             <height>16</height>
+            </size>
+           </property>
+           <property name="cursor">
+            <cursorShape>PointingHandCursor</cursorShape>
+           </property>
+           <property name="focusPolicy">
+            <enum>Qt::StrongFocus</enum>
+           </property>
+           <property name="toolTip">
+            <string>Marker frequency (Hz)</string>
+           </property>
+           <property name="text">
+            <string>Hz</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QComboBox" name="aMarkerShowState">
+           <property name="toolTip">
+            <string>Marker show state</string>
+           </property>
+           <item>
             <property name="text">
-             <string>All</string>
+             <string>Hidden</string>
             </property>
-           </widget>
-          </item>
-          <item>
-           <spacer name="horizontalSpacer_7">
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
+           </item>
+           <item>
+            <property name="text">
+             <string>Top</string>
             </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
+           </item>
+           <item>
+            <property name="text">
+             <string>Full</string>
             </property>
-           </spacer>
-          </item>
-         </layout>
-        </item>
-       </layout>
-      </widget>
+           </item>
+           <item>
+            <property name="text">
+             <string>Text</string>
+            </property>
+           </item>
+          </widget>
+         </item>
+         <item>
+          <widget class="QPushButton" name="aMarkerShowStateAll">
+           <property name="maximumSize">
+            <size>
+             <width>30</width>
+             <height>16777215</height>
+            </size>
+           </property>
+           <property name="toolTip">
+            <string>Apply current show state to all markers</string>
+           </property>
+           <property name="text">
+            <string>All</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer name="horizontalSpacer_7">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <spacer name="verticalSpacer_3">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>40</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
      </widget>
     </widget>
    </item>
@@ -1808,6 +1865,11 @@ All  - Show all markers</string>
   </layout>
  </widget>
  <customwidgets>
+  <customwidget>
+   <class>ButtonSwitch</class>
+   <extends>QToolButton</extends>
+   <header>gui/buttonswitch.h</header>
+  </customwidget>
   <customwidget>
    <class>ValueDialZ</class>
    <extends>QWidget</extends>
@@ -1819,11 +1881,6 @@ All  - Show all markers</string>
    <extends>QLabel</extends>
    <header>gui/clickablelabel.h</header>
   </customwidget>
-  <customwidget>
-   <class>ButtonSwitch</class>
-   <extends>QToolButton</extends>
-   <header>gui/buttonswitch.h</header>
-  </customwidget>
  </customwidgets>
  <tabstops>
   <tabstop>buttonBox</tabstop>