Merge pull request #1355 from ispyisail/feat/upright-symbol-texts
Linux build and tests / Build and test (Qt 6, Debug) (push) Failing after 1m54s

Add an option to keep texts of turned symbols horizontal
This commit is contained in:
ispyisail
2026-10-07 21:39:49 +13:00
committed by GitHub
14 changed files with 444 additions and 103 deletions
@@ -185,6 +185,11 @@ void ProjectMainConfigPage::applyProjectConf()
modified_project = true;
}
if (m_project -> uprightSymbolTexts() != upright_symbol_texts_cb_ -> isChecked()) {
m_project -> setUprightSymbolTexts(upright_symbol_texts_cb_ -> isChecked());
modified_project = true;
}
//Following the application's rules stores nothing in the project
WiringRules::Settings wiring_rules;
if (!use_application_rules_cb_ -> isChecked()) {
@@ -252,6 +257,14 @@ void ProjectMainConfigPage::initWidgets()
"Seul le dessin change : aucun élément n'est ajouté et aucun conducteur n'est coupé.",
"tooltip"));
//Texts of turned symbols kept horizontal
upright_symbol_texts_cb_ = new QCheckBox(tr("Garder horizontaux les textes des symboles pivotés",
"checkbox label"));
upright_symbol_texts_cb_ -> setToolTip(tr("Les textes dessinés dans un symbole et les noms de ses bornes restent "
"lisibles quand le symbole est pivoté : leur cadre tourne avec le symbole, "
"pas le texte. Décochez pour qu'ils tournent avec le symbole, comme avant.",
"tooltip"));
//How many wires a terminal may take (discussion #1158)
wiring_rules_gb_ = new QGroupBox(tr("Conducteurs par borne", "group box title"));
use_application_rules_cb_ = new QCheckBox(tr("Utiliser les réglages de l'application", "checkbox label"));
@@ -318,6 +331,9 @@ void ProjectMainConfigPage::initLayout()
main_layout0 -> addLayout(wire_hops_layout0);
main_layout0 -> addSpacing(10);
main_layout0 -> addWidget(upright_symbol_texts_cb_);
main_layout0 -> addSpacing(10);
QVBoxLayout *wiring_rules_layout = new QVBoxLayout(wiring_rules_gb_);
wiring_rules_layout -> addWidget(use_application_rules_cb_);
QHBoxLayout *max_wires_layout = new QHBoxLayout();
@@ -351,6 +367,7 @@ void ProjectMainConfigPage::readValuesFromProject()
const int wire_hops_index = wire_hops_cb_ -> findData(WireHops::toString(m_project -> wireHops()));
wire_hops_cb_ -> setCurrentIndex(qMax(0, wire_hops_index));
upright_symbol_texts_cb_ -> setChecked(m_project -> uprightSymbolTexts());
//The rules that apply: the project's own or the application's
const WiringRules::Settings wiring_rules = m_project -> wiringRules();
@@ -406,6 +423,7 @@ void ProjectMainConfigPage::adjustReadOnly()
usage_enabled_cb_ -> setDisabled(is_read_only);
usage_reset_pb_ -> setDisabled(is_read_only);
wire_hops_cb_ -> setDisabled(is_read_only);
upright_symbol_texts_cb_ -> setDisabled(is_read_only);
wiring_rules_gb_ -> setDisabled(is_read_only);
}
@@ -139,6 +139,7 @@ class ProjectMainConfigPage : public ProjectConfigPage {
QPushButton *usage_reset_pb_;
QLabel *wire_hops_label_;
QComboBox *wire_hops_cb_;
QCheckBox *upright_symbol_texts_cb_;
QGroupBox *wiring_rules_gb_;
QCheckBox *use_application_rules_cb_;
QLabel *max_wires_label_;