Automatically set the width of the mode buttons depending on the font size.

This commit is contained in:
Uwe Risse 2022-04-05 11:14:34 +02:00
parent 55bc403f83
commit cf9233b650

View File

@ -745,25 +745,23 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
} }
}); });
#if !defined(Q_OS_MAC) // ensure a balanced layout of the mode buttons
// ensure a balanced layout of the mode buttons both on Windos and MacOS qreal pointSize = m_config.text_font().pointSizeF();
ui->houndButton->setMaximumWidth(40); if (pointSize < 12) {
ui->ft8Button->setMaximumWidth(40); ui->houndButton->setMaximumWidth(40);
ui->ft4Button->setMaximumWidth(40); ui->ft8Button->setMaximumWidth(40);
ui->msk144Button->setMaximumWidth(40); ui->ft4Button->setMaximumWidth(40);
ui->q65Button->setMaximumWidth(40); ui->msk144Button->setMaximumWidth(40);
ui->jt65Button->setMaximumWidth(40); ui->q65Button->setMaximumWidth(40);
#endif ui->jt65Button->setMaximumWidth(40);
} else {
#if defined(Q_OS_MAC) ui->houndButton->setMinimumWidth(0);
// ensure a balanced layout of the mode buttons both on Windos and MacOS ui->ft8Button->setMinimumWidth(0);
ui->houndButton->setMinimumWidth(0); ui->ft4Button->setMinimumWidth(0);
ui->ft8Button->setMinimumWidth(0); ui->msk144Button->setMinimumWidth(0);
ui->ft4Button->setMinimumWidth(0); ui->q65Button->setMinimumWidth(0);
ui->msk144Button->setMinimumWidth(0); ui->jt65Button->setMinimumWidth(0);
ui->q65Button->setMinimumWidth(0); }
ui->jt65Button->setMinimumWidth(0);
#endif
// hook up save WAV file exit handling // hook up save WAV file exit handling
connect (&m_saveWAVWatcher, &QFutureWatcher<QString>::finished, [this] { connect (&m_saveWAVWatcher, &QFutureWatcher<QString>::finished, [this] {