From cebed44ccd0f43bbaf20663e8dc28d2170620cf1 Mon Sep 17 00:00:00 2001 From: Jordan Sherer Date: Mon, 12 Nov 2018 16:34:31 -0500 Subject: [PATCH] User Interface Tweaks: * Changed Window Menu to View Menu * Added Show Clock to View Menu * Changed minimum sizing for better fit on smaller screens * Reordered Clock and Date for Clock Priority --- mainwindow.cpp | 27 ++++++++++---- mainwindow.h | 1 + mainwindow.ui | 99 +++++++++++++++++++++++++++++++++++++++----------- 3 files changed, 97 insertions(+), 30 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 6cc0388..0d8c297 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1102,10 +1102,9 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, ui->menuTools->setEnabled(false); ui->menuView->setEnabled(false); foreach(auto action, ui->menuBar->actions()){ - if(action->text() == "View") ui->menuBar->removeAction(action); - if(action->text() == "Mode") ui->menuBar->removeAction(action); - //if(action->text() == "Decode") ui->menuBar->removeAction(action); - if(action->text() == "Tools") ui->menuBar->removeAction(action); + if(action->text() == "Old View") ui->menuBar->removeAction(action); + if(action->text() == "Old Mode") ui->menuBar->removeAction(action); + if(action->text() == "Old Tools") ui->menuBar->removeAction(action); } ui->dxCallEntry->clear(); ui->dxGridEntry->clear(); @@ -1762,8 +1761,9 @@ void MainWindow::readSettings() ui->cbAutoSeq->setVisible(false); ui->cbFirst->setVisible(false); m_settings->beginGroup("MainWindow"); + setMinimumSize(800, 400); restoreGeometry (m_settings->value ("geometry", saveGeometry ()).toByteArray ()); - setMinimumSize(800, 545); + setMinimumSize(800, 400); m_geometryNoControls = m_settings->value ("geometryNoControls",saveGeometry()).toByteArray(); restoreState (m_settings->value ("state", saveState ()).toByteArray ()); @@ -2304,6 +2304,7 @@ void MainWindow::on_menuWindow_aboutToShow(){ ui->actionShow_Call_Activity->setChecked(hsizes.at(2) > 0); auto vsizes = ui->mainSplitter->sizes(); + ui->actionShow_Frequency_Clock->setChecked(vsizes.first() > 0); ui->actionShow_Waterfall->setChecked(vsizes.last() > 0); ui->actionShow_Waterfall_Controls->setChecked(m_wideGraph->controlsVisible()); ui->actionShow_Waterfall_Controls->setEnabled(ui->actionShow_Waterfall->isChecked()); @@ -2343,6 +2344,13 @@ void MainWindow::on_menuWindow_aboutToShow(){ #endif } +void MainWindow::on_actionShow_Frequency_Clock_triggered(bool checked){ + auto vsizes = ui->mainSplitter->sizes(); + vsizes[0] = checked ? ui->logHorizontalWidget->minimumHeight() : 0; + ui->logHorizontalWidget->setVisible(checked); + ui->mainSplitter->setSizes(vsizes); +} + void MainWindow::on_actionShow_Band_Activity_triggered(bool checked){ auto hsizes = ui->textHorizontalSplitter->sizes(); hsizes[0] = checked ? ui->textHorizontalSplitter->width()/4 : 0; @@ -2435,6 +2443,8 @@ void MainWindow::openSettings(int tab){ m_msAudioOutputBuffered); } + ui->bandComboBox->view ()->setMinimumWidth (ui->bandComboBox->view ()->sizeHintForColumn (FrequencyList_v2::frequency_mhz_column)); + displayDialFrequency (); displayActivity(true); @@ -4405,9 +4415,10 @@ void MainWindow::guiUpdate() auto drift = DriftingDateTime::drift(); QDateTime t = DriftingDateTime::currentDateTimeUtc(); - QString utc = t.date().toString("yyyy MMM dd") + "\n " + - t.time().toString() + (!drift ? " " : QString(" (%1%2ms)").arg(drift > 0 ? "+" : "").arg(drift)); - ui->labUTC->setText(utc); + QStringList parts; + parts << (t.time().toString() + (!drift ? " " : QString(" (%1%2ms)").arg(drift > 0 ? "+" : "").arg(drift))); + parts << t.date().toString("yyyy MMM dd"); + ui->labUTC->setText(parts.join("\n")); auto delta = t.secsTo(m_nextHeartbeat); QString ping; diff --git a/mainwindow.h b/mainwindow.h index 1e796c0..95f7ca4 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -171,6 +171,7 @@ private slots: void on_tx5_currentTextChanged (QString const&); void on_tx6_editingFinished(); void on_menuWindow_aboutToShow(); + void on_actionShow_Frequency_Clock_triggered(bool checked); void on_actionShow_Band_Activity_triggered(bool checked); void on_actionShow_Call_Activity_triggered(bool checked); void on_actionShow_Waterfall_triggered(bool checked); diff --git a/mainwindow.ui b/mainwindow.ui index 8917a7f..05aed1a 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -7,7 +7,7 @@ 0 0 872 - 566 + 605 @@ -23,6 +23,12 @@ + + + 0 + 0 + + 6 @@ -60,7 +66,7 @@ 0 - 0 + 1 @@ -395,7 +401,7 @@ color : white; 0 - <html><head/><body><p align="center"><span style=" font-size:12pt;">2015 Jun 17 </span></p><p align="center"><span style=" font-size:12pt;">01:23:45 </span></p></body></html> + <html><head/><body><p align="center"><span style=" font-size:12pt;">01:23:45<br/>2015 Jun 17 </span></p></body></html> Qt::AlignCenter @@ -1171,15 +1177,15 @@ background-color: #00ff00; - + 0 - 0 + 4 0 - 100 + 75 @@ -1707,11 +1713,17 @@ color:#555; - + 0 - 2 + 0 + + + 0 + 10 + + QFrame::NoFrame @@ -1736,6 +1748,12 @@ color:#555; + + + 0 + 0 + + 0 @@ -1757,8 +1775,17 @@ color:#555; 0 + + QLayout::SetDefaultConstraint + + + + 0 + 0 + + 0 @@ -1789,6 +1816,12 @@ color:#555; + + + 0 + 0 + + 0 @@ -1889,7 +1922,7 @@ background-color: #00ff00; 75 - 0 + 1 @@ -1923,14 +1956,14 @@ background-color: #00ff00; - + 10 0 - 0 + 1 1 @@ -1950,13 +1983,16 @@ background-color: #00ff00; + + QLayout::SetNoConstraint + 4 - + 1 0 @@ -1964,7 +2000,7 @@ background-color: #00ff00; 60 - 0 + 1 @@ -2028,6 +2064,12 @@ background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #2ecc71, stop:1 #00FF + + + 0 + 0 + + 0 @@ -2920,7 +2962,7 @@ background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #2ecc71, stop:1 #00FF QTabWidget::Triangular - 3 + 0 @@ -4710,7 +4752,7 @@ list. The list can be maintained in Settings (F2). false - View + Old View @@ -4771,7 +4813,7 @@ list. The list can be maintained in Settings (F2). false - Mode + Old Mode @@ -4797,7 +4839,7 @@ list. The list can be maintained in Settings (F2). - Tools + Old Tools @@ -4810,8 +4852,10 @@ list. The list can be maintained in Settings (F2). - &Window + &View + + @@ -4839,14 +4883,14 @@ list. The list can be maintained in Settings (F2). - - - + + + @@ -5542,7 +5586,7 @@ list. The list can be maintained in Settings (F2). - Reset Window Sizes + Reset Frame Sizes @@ -5611,6 +5655,17 @@ list. The list can be maintained in Settings (F2). Deep (3x) + + + true + + + true + + + Show Frequency && Clock + +