mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-25 05:38:46 -05:00
Improve wide graph control hiding and layouts
Thanks to Mike, W9MDB, for this contribution. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7604 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
f65242cd74
commit
abe4ad6a0d
@ -83,9 +83,7 @@ WideGraph::WideGraph(QSettings * settings, QWidget *parent) :
|
||||
int m_fMin = m_settings->value ("Fmin", 2500).toInt ();
|
||||
ui->fSplitSpinBox->setValue (m_fMin);
|
||||
setRxRange (m_fMin);
|
||||
m_bHideControls = m_settings->value("HideControls", false).toBool ();
|
||||
m_bHideControls = !m_bHideControls; // we're not toggling here so we start in opposite state
|
||||
on_hideControls();
|
||||
ui->controls_widget->setVisible(!m_settings->value("HideControls", false).toBool ());
|
||||
m_settings->endGroup();
|
||||
|
||||
saveSettings (); // update config with defaults
|
||||
@ -116,57 +114,6 @@ void WideGraph::closeEvent (QCloseEvent * e)
|
||||
QDialog::closeEvent (e);
|
||||
}
|
||||
|
||||
void WideGraph::on_hideControls()
|
||||
{
|
||||
m_bHideControls = !m_bHideControls;
|
||||
ui->verticalLayout->setEnabled(!m_bHideControls);
|
||||
ui->gridLayout->setEnabled(!m_bHideControls);
|
||||
ui->horizontalLayout->setEnabled(!m_bHideControls);
|
||||
ui->horizontalLayout_2->setEnabled(!m_bHideControls);
|
||||
ui->horizontalLayout_3->setEnabled(!m_bHideControls);
|
||||
if (!m_bHideControls) {
|
||||
ui->adjust_palette_push_button->show();
|
||||
ui->labPalette->show();
|
||||
ui->smoSpinBox->show();
|
||||
ui->cbFlatten->show();
|
||||
ui->cbRef->show();
|
||||
ui->bppSpinBox->show();
|
||||
ui->fSplitSpinBox->show();
|
||||
ui->fStartSpinBox->show();
|
||||
ui->gain2dSlider->show();
|
||||
ui->gainSlider->show();
|
||||
ui->line->show();
|
||||
ui->line_2->show();
|
||||
ui->paletteComboBox->show();
|
||||
ui->sbPercent2dPlot->show();
|
||||
ui->spec2dComboBox->show();
|
||||
ui->waterfallAvgSpinBox->show();
|
||||
ui->zero2dSlider->show();
|
||||
ui->zeroSlider->show();
|
||||
}
|
||||
else {
|
||||
ui->adjust_palette_push_button->hide();
|
||||
ui->labPalette->hide();
|
||||
ui->smoSpinBox->hide();
|
||||
ui->cbFlatten->hide();
|
||||
ui->cbRef->hide();
|
||||
ui->bppSpinBox->hide();
|
||||
ui->fSplitSpinBox->hide();
|
||||
ui->fStartSpinBox->hide();
|
||||
ui->gain2dSlider->hide();
|
||||
ui->gainSlider->hide();
|
||||
ui->line->hide();
|
||||
ui->line_2->hide();
|
||||
ui->paletteComboBox->hide();
|
||||
ui->sbPercent2dPlot->hide();
|
||||
ui->spec2dComboBox->hide();
|
||||
ui->waterfallAvgSpinBox->hide();
|
||||
ui->zero2dSlider->hide();
|
||||
ui->zeroSlider->hide();
|
||||
ui->widePlot->adjustSize();
|
||||
}
|
||||
}
|
||||
|
||||
void WideGraph::saveSettings() //saveSettings
|
||||
{
|
||||
m_settings->beginGroup ("WideGraph");
|
||||
@ -191,7 +138,7 @@ void WideGraph::saveSettings() //saveS
|
||||
m_settings->setValue ("Fmin", m_fMin);
|
||||
m_settings->setValue("Flatten",m_bFlatten);
|
||||
m_settings->setValue("UseRef",m_bRef);
|
||||
m_settings->setValue("HideControls",m_bHideControls);
|
||||
m_settings->setValue("HideControls",!ui->controls_widget->isVisible());
|
||||
m_settings->endGroup ();
|
||||
}
|
||||
|
||||
@ -275,7 +222,7 @@ void WideGraph::keyPressEvent(QKeyEvent *e) //F1
|
||||
break;
|
||||
case Qt::Key_M:
|
||||
if(e->modifiers() & Qt::ControlModifier) {
|
||||
on_hideControls();
|
||||
ui->controls_widget->setVisible(!ui->controls_widget->isVisible());
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -63,8 +63,8 @@ public slots:
|
||||
void setDialFreq(double d);
|
||||
|
||||
protected:
|
||||
virtual void keyPressEvent( QKeyEvent *e );
|
||||
void closeEvent (QCloseEvent *);
|
||||
void keyPressEvent (QKeyEvent *e) override;
|
||||
void closeEvent (QCloseEvent *) override;
|
||||
|
||||
private slots:
|
||||
void on_waterfallAvgSpinBox_valueChanged(int arg1);
|
||||
@ -82,7 +82,6 @@ private slots:
|
||||
void on_zero2dSlider_valueChanged(int value);
|
||||
void on_smoSpinBox_valueChanged(int n);
|
||||
void on_sbPercent2dPlot_valueChanged(int n);
|
||||
void on_hideControls();
|
||||
|
||||
private:
|
||||
void readPalette();
|
||||
@ -107,7 +106,6 @@ private:
|
||||
bool m_bFlatten;
|
||||
bool m_bRef;
|
||||
bool m_bHaveTransmitted; //Set true at end of a WSPR transmission
|
||||
bool m_bHideControls;
|
||||
QString m_mode;
|
||||
QString m_modeTx;
|
||||
QString m_waterfallPalette;
|
||||
|
982
widegraph.ui
982
widegraph.ui
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user