commit ee7c1b74462e2dedf0da9afdfb5aa8152b5d3a6a
Author: Juergen Spitzmueller <[email protected]>
Date: Tue Dec 9 14:00:25 2025 +0100
Fix margin labels in one-side mode (#13263)
Also improve implementation
(cherry picked from commit a635ec42cbfdf93bf18cd0aed3e8644ad064bc8d)
---
src/frontends/qt/GuiDocument.cpp | 20 ++++++++++++--------
src/frontends/qt/GuiDocument.h | 2 +-
2 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/src/frontends/qt/GuiDocument.cpp b/src/frontends/qt/GuiDocument.cpp
index b48f4a1c7e..67fb6c90b4 100644
--- a/src/frontends/qt/GuiDocument.cpp
+++ b/src/frontends/qt/GuiDocument.cpp
@@ -1232,8 +1232,12 @@ GuiDocument::GuiDocument(GuiView & lv)
this, SLOT(change_adaptor()));
connect(pageLayoutModule->facingPagesCB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
+#if QT_VERSION < QT_VERSION_CHECK(6, 7, 0)
connect(pageLayoutModule->facingPagesCB, SIGNAL(stateChanged(int)),
- this, SLOT(updateMarginLabels(int)));
+#else
+ connect(pageLayoutModule->facingPagesCB,
SIGNAL(checkStateChanged(Qt::CheckState)),
+#endif
+ this, SLOT(updateMarginLabels()));
connect(pageLayoutModule->pagestyleCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
@@ -2032,16 +2036,16 @@ void GuiDocument::changeTrackingChanged(bool state)
}
-void GuiDocument::updateMarginLabels(int state)
+void GuiDocument::updateMarginLabels()
{
- if (state == 0) {
- // Two-sided
- marginsModule->outerL->setText(qt_("&Left:"));
- marginsModule->innerL->setText(qt_("&Right:"));
- } else {
+ if (pageLayoutModule->facingPagesCB->isChecked()) {
// Two-sided
marginsModule->outerL->setText(qt_("&Outer:"));
marginsModule->innerL->setText(qt_("&Inner:"));
+ } else {
+ // One-sided
+ marginsModule->outerL->setText(qt_("&Right:"));
+ marginsModule->innerL->setText(qt_("&Left:"));
}
}
@@ -4771,7 +4775,7 @@ void GuiDocument::paramsToDialog()
pageLayoutModule->facingPagesCB->setChecked(
bp_.sides == TwoSides);
- updateMarginLabels(pageLayoutModule->facingPagesCB->checkState());
+ updateMarginLabels();
lengthToWidgets(pageLayoutModule->paperwidthLE,
pageLayoutModule->paperwidthUnitCO, bp_.paperwidth,
default_unit);
diff --git a/src/frontends/qt/GuiDocument.h b/src/frontends/qt/GuiDocument.h
index d80c439a6a..686ab5a1ed 100644
--- a/src/frontends/qt/GuiDocument.h
+++ b/src/frontends/qt/GuiDocument.h
@@ -183,7 +183,7 @@ private Q_SLOTS:
void renameCustomColor();
void alterCustomColor();
void toggleCustomColor(QTreeWidgetItem *, int);
- void updateMarginLabels(int);
+ void updateMarginLabels();
private:
/// validate listings parameters and return an error message, if any
QString validateListingsParameters();
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs