diff --git a/sdrgui/gui/glspectrumgui.cpp b/sdrgui/gui/glspectrumgui.cpp index c6c6c105f..cd7793d5e 100644 --- a/sdrgui/gui/glspectrumgui.cpp +++ b/sdrgui/gui/glspectrumgui.cpp @@ -49,15 +49,17 @@ GLSpectrumGUI::GLSpectrumGUI(QWidget* parent) : ui->setupUi(this); // Use the custom flow layout for the 3 main horizontal layouts (lines) + ui->verticalLayout->removeItem(ui->Line5Layout); ui->verticalLayout->removeItem(ui->Line4Layout); ui->verticalLayout->removeItem(ui->Line3Layout); ui->verticalLayout->removeItem(ui->Line2Layout); ui->verticalLayout->removeItem(ui->Line1Layout); FlowLayout *flowLayout = new FlowLayout(nullptr, 1, 1, 1); flowLayout->addItem(ui->Line3Layout); + flowLayout->addItem(ui->Line4Layout); flowLayout->addItem(ui->Line1Layout); flowLayout->addItem(ui->Line2Layout); - flowLayout->addItem(ui->Line4Layout); + flowLayout->addItem(ui->Line5Layout); ui->verticalLayout->addItem(flowLayout); on_linscale_toggled(false); @@ -162,9 +164,16 @@ void GLSpectrumGUI::displaySettings() ui->spectrogramStyle->setCurrentIndex((int) m_settings.m_3DSpectrogramStyle); ui->spectrogramStyle->setVisible(m_settings.m_display3DSpectrogram); ui->colorMap->setCurrentText(m_settings.m_colorMap); - ui->spectrumStyle->setCurrentIndex((int) m_settings.m_spectrumStyle); + ui->currentLine->blockSignals(true); + ui->currentFill->blockSignals(true); + ui->currentGradient->blockSignals(true); + ui->currentLine->setChecked(m_settings.m_displayCurrent && (m_settings.m_spectrumStyle == SpectrumSettings::SpectrumStyle::Line)); + ui->currentFill->setChecked(m_settings.m_displayCurrent && (m_settings.m_spectrumStyle == SpectrumSettings::SpectrumStyle::Fill)); + ui->currentGradient->setChecked(m_settings.m_displayCurrent && (m_settings.m_spectrumStyle == SpectrumSettings::SpectrumStyle::Gradient)); + ui->currentLine->blockSignals(false); + ui->currentFill->blockSignals(false); + ui->currentGradient->blockSignals(false); ui->maxHold->setChecked(m_settings.m_displayMaxHold); - ui->current->setChecked(m_settings.m_displayCurrent); ui->histogram->setChecked(m_settings.m_displayHistogram); ui->invertWaterfall->setChecked(m_settings.m_invertedWaterfall); ui->grid->setChecked(m_settings.m_displayGrid); @@ -464,12 +473,6 @@ void GLSpectrumGUI::on_stroke_valueChanged(int index) applySettings(); } -void GLSpectrumGUI::on_spectrumStyle_currentIndexChanged(int index) -{ - m_settings.m_spectrumStyle = (SpectrumSettings::SpectrumStyle)index; - applySettings(); -} - void GLSpectrumGUI::on_spectrogramStyle_currentIndexChanged(int index) { m_settings.m_3DSpectrogramStyle = (SpectrumSettings::SpectrogramStyle)index; @@ -520,8 +523,41 @@ void GLSpectrumGUI::on_maxHold_toggled(bool checked) applySettings(); } -void GLSpectrumGUI::on_current_toggled(bool checked) +void GLSpectrumGUI::on_currentLine_toggled(bool checked) { + ui->currentFill->blockSignals(true); + ui->currentGradient->blockSignals(true); + ui->currentFill->setChecked(false); + ui->currentGradient->setChecked(false); + ui->currentFill->blockSignals(false); + ui->currentGradient->blockSignals(false); + m_settings.m_spectrumStyle = SpectrumSettings::SpectrumStyle::Line; + m_settings.m_displayCurrent = checked; + applySettings(); +} + +void GLSpectrumGUI::on_currentFill_toggled(bool checked) +{ + ui->currentLine->blockSignals(true); + ui->currentGradient->blockSignals(true); + ui->currentLine->setChecked(false); + ui->currentGradient->setChecked(false); + ui->currentLine->blockSignals(false); + ui->currentGradient->blockSignals(false); + m_settings.m_spectrumStyle = SpectrumSettings::SpectrumStyle::Fill; + m_settings.m_displayCurrent = checked; + applySettings(); +} + +void GLSpectrumGUI::on_currentGradient_toggled(bool checked) +{ + ui->currentLine->blockSignals(true); + ui->currentFill->blockSignals(true); + ui->currentLine->setChecked(false); + ui->currentFill->setChecked(false); + ui->currentLine->blockSignals(false); + ui->currentFill->blockSignals(false); + m_settings.m_spectrumStyle = SpectrumSettings::SpectrumStyle::Gradient; m_settings.m_displayCurrent = checked; applySettings(); } diff --git a/sdrgui/gui/glspectrumgui.h b/sdrgui/gui/glspectrumgui.h index b978fd401..31ba3f2d8 100644 --- a/sdrgui/gui/glspectrumgui.h +++ b/sdrgui/gui/glspectrumgui.h @@ -96,7 +96,6 @@ private slots: void on_decay_valueChanged(int index); void on_decayDivisor_valueChanged(int index); void on_stroke_valueChanged(int index); - void on_spectrumStyle_currentIndexChanged(int index); void on_spectrogramStyle_currentIndexChanged(int index); void on_colorMap_currentIndexChanged(int index); void on_gridIntensity_valueChanged(int index); @@ -111,7 +110,9 @@ private slots: void on_spectrogram_toggled(bool checked); void on_histogram_toggled(bool checked); void on_maxHold_toggled(bool checked); - void on_current_toggled(bool checked); + void on_currentLine_toggled(bool checked); + void on_currentFill_toggled(bool checked); + void on_currentGradient_toggled(bool checked); void on_invertWaterfall_toggled(bool checked); void on_grid_toggled(bool checked); void on_clearSpectrum_clicked(bool checked); diff --git a/sdrgui/gui/glspectrumgui.ui b/sdrgui/gui/glspectrumgui.ui index 1fb6d7e7f..d0b6a4fc9 100644 --- a/sdrgui/gui/glspectrumgui.ui +++ b/sdrgui/gui/glspectrumgui.ui @@ -6,8 +6,8 @@ 0 0 - 364 - 137 + 630 + 151 @@ -565,6 +565,54 @@ 1 + + + + Toggle the scale grid + + + Grid + + + + :/grid.png:/grid.png + + + + 16 + 16 + + + + true + + + + + + + + 24 + 24 + + + + ArrowCursor + + + Grid intensity + + + 100 + + + 1 + + + 5 + + + @@ -614,6 +662,29 @@ + + + + Display max hold + + + Max Hold + + + + :/bell_red.png:/bell_red.png + + + + 16 + 16 + + + + true + + + @@ -678,30 +749,30 @@ - - - Display max hold + + + + 0 + 0 + - - Max Hold - - - - :/maxhold.png:/maxhold.png - - + - 16 - 16 + 5 + 22 - - true + + + + + + - + Display live spectrum @@ -710,7 +781,7 @@ - :/current.png:/current.png + :/bell_line.png:/bell_line.png @@ -724,37 +795,49 @@ - - - - 80 - 0 - - - - - 80 - 16777215 - - + - Spectrum Style + Display live spectrum + + + Max Hold + + + + :/bell_fill.png:/bell_fill.png + + + + 16 + 16 + + + + true + + + + + + + Display live spectrum + + + Max Hold + + + + :/bell_gradient.png:/bell_gradient.png + + + + 16 + 16 + + + + true - - - Line - - - - - Fill - - - - - Gradient - - @@ -779,6 +862,25 @@ + + + + + 70 + 0 + + + + + 80 + 16777215 + + + + Color Map + + + @@ -898,96 +1000,10 @@ - - - - - 70 - 0 - - - - - 80 - 16777215 - - - - Color Map - - - - - - - Toggle the scale grid - - - Grid - - - - :/grid.png:/grid.png - - - - 16 - 16 - - - - true - - - - - - - - 24 - 24 - - - - ArrowCursor - - - Grid intensity - - - 100 - - - 1 - - - 5 - - - - - - - - 0 - 0 - - - - - 5 - 22 - - - - - - - - + @@ -1083,11 +1099,6 @@
gui/buttonswitch.h
- - maxHold - invertWaterfall - grid - diff --git a/sdrgui/resources/bell_fill.png b/sdrgui/resources/bell_fill.png new file mode 100644 index 000000000..d7430a833 Binary files /dev/null and b/sdrgui/resources/bell_fill.png differ diff --git a/sdrgui/resources/bell_gradient.png b/sdrgui/resources/bell_gradient.png new file mode 100644 index 000000000..bcd32374f Binary files /dev/null and b/sdrgui/resources/bell_gradient.png differ diff --git a/sdrgui/resources/bell_line.png b/sdrgui/resources/bell_line.png new file mode 100644 index 000000000..3cb4e8688 Binary files /dev/null and b/sdrgui/resources/bell_line.png differ diff --git a/sdrgui/resources/bell_red.png b/sdrgui/resources/bell_red.png new file mode 100644 index 000000000..fb3ca9c14 Binary files /dev/null and b/sdrgui/resources/bell_red.png differ diff --git a/sdrgui/resources/res.qrc b/sdrgui/resources/res.qrc index 12217363d..c3db0a837 100644 --- a/sdrgui/resources/res.qrc +++ b/sdrgui/resources/res.qrc @@ -1,5 +1,9 @@ + bell_red.png + bell_fill.png + bell_gradient.png + bell_line.png ruler.png sort.png audio_mic.png