Include some fonts to QElectroTech

- include Liberation-Fonts and osifont
  (thanks elevatormind!)
- use "Liberation Sans" as default-font
- adjust License-Tab in About-Form
- Bugfix: When selecting a font, the current
  font is highlighted in dialog
- adjust some whitespace and English comments
This commit is contained in:
plc-user
2025-05-18 14:15:20 +02:00
parent cf39ae2417
commit c7ed744481
66 changed files with 3423 additions and 3232 deletions

View File

@@ -41,7 +41,7 @@ AboutQETDialog::AboutQETDialog(QWidget *parent) :
setVersion();
setAnnexProject();
setLibraries();
setLicence();
setLicenses();
setLoginfo();
}
@@ -195,11 +195,14 @@ void AboutQETDialog::setLibraries()
}
/**
@brief AboutQETDialog::setLicence
@brief AboutQETDialog::setLicenses
*/
void AboutQETDialog::setLicence()
void AboutQETDialog::setLicenses()
{
ui->m_license_text_edit->setPlainText(QET::license());
ui->m_licenses_comboBox->addItem("QElectroTech");
ui->m_licenses_comboBox->addItem("QET-Elements");
ui->m_licenses_comboBox->addItem("liberation-fonts");
ui->m_licenses_comboBox->addItem("osifont");
}
/**
@@ -257,6 +260,32 @@ void AboutQETDialog::addLibrary(QLabel *label, const QString &name, const QStrin
label->setText(new_text);
}
/**
@brief Updates the displayed license text when a different one is selected
This slot is called when the user selects a different license in the
licenses combo box. It retrieves the selected license text from QET's
license collection and displays it in the text edit widgets.
@param license_name The identifier of the selected license
*/
void AboutQETDialog::on_m_licenses_comboBox_currentTextChanged(
const QString &license_name)
{
std::tuple<QString, QString> license_info = QET::licenses(license_name);
ui->m_licenses_notice_plainTextEdit->setPlainText(std::get<0>(license_info));
ui->m_licenses_license_plainTextEdit->setPlainText(std::get<1>(license_info));
//adjust height of notice-field:
int LineCount = ui->m_licenses_notice_plainTextEdit->blockCount();
if (LineCount <= 4) {
QFontMetrics qfm (ui->m_licenses_notice_plainTextEdit->font());
int LineHeight = qfm.lineSpacing();
ui->m_licenses_notice_plainTextEdit->setMaximumHeight((LineCount + 1) * LineHeight);
} else {
ui->m_licenses_notice_plainTextEdit->setMaximumHeight(16777215);
}
}
void AboutQETDialog::on_m_log_comboBox_currentTextChanged(const QString &arg1)
{
QFile log_File(arg1);