[LyX/master] PDF options: reflect in UI mutually exclusive colorlinks and frames.

Pavel Sanda sanda at lyx.org
Mon Sep 30 18:10:18 UTC 2024


commit 601abfe929193a01e4f84e176a5f3aca7d57cd46
Author: Pavel Sanda <sanda at lyx.org>
Date:   Mon Sep 30 20:06:38 2024 +0200

    PDF options: reflect in UI mutually exclusive colorlinks and frames.
    
    https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg222961.html
---
 src/frontends/qt/GuiDocument.cpp    | 12 ++++++++++++
 src/frontends/qt/GuiDocument.h      |  1 +
 src/frontends/qt/ui/PDFSupportUi.ui |  3 +++
 3 files changed, 16 insertions(+)

diff --git a/src/frontends/qt/GuiDocument.cpp b/src/frontends/qt/GuiDocument.cpp
index 4eb945e1af..a98680b9a5 100644
--- a/src/frontends/qt/GuiDocument.cpp
+++ b/src/frontends/qt/GuiDocument.cpp
@@ -1784,6 +1784,8 @@ GuiDocument::GuiDocument(GuiView & lv)
 		this, SLOT(change_adaptor()));
 	connect(pdfSupportModule->pdfborderCB, SIGNAL(toggled(bool)),
 		this, SLOT(change_adaptor()));
+	connect(pdfSupportModule->colorlinksCB, SIGNAL(toggled(bool)),
+		this, SLOT(colorlinksCB_adaptor(bool)));
 	connect(pdfSupportModule->colorlinksCB, SIGNAL(toggled(bool)),
 		this, SLOT(change_adaptor()));
 	connect(pdfSupportModule->backrefCO, SIGNAL(activated(int)),
@@ -3152,6 +3154,12 @@ void GuiDocument::classChanged_adaptor()
 }
 
 
+void GuiDocument::colorlinksCB_adaptor(bool enabled)
+{
+	pdfSupportModule->pdfborderCB->setEnabled(!enabled);
+}
+
+
 void GuiDocument::classChanged()
 {
 	int idx = latexModule->classCO->currentIndex();
@@ -4879,6 +4887,10 @@ void GuiDocument::paramsToDialog()
 	pdfSupportModule->pdfusetitleCB->setChecked(pdf.pdfusetitle);
 	pdfSupportModule->colorlinksCB->setChecked(pdf.colorlinks);
 
+	//hyperref considers colorlinks to be mutually exlusive to borders
+	//for workaround see manuals
+	pdfSupportModule->pdfborderCB->setEnabled(!pdf.colorlinks);
+
 	nn = findToken(backref_opts, pdf.backref);
 	if (nn >= 0)
 		pdfSupportModule->backrefCO->setCurrentIndex(nn);
diff --git a/src/frontends/qt/GuiDocument.h b/src/frontends/qt/GuiDocument.h
index 3e49fa663d..8ff27f5670 100644
--- a/src/frontends/qt/GuiDocument.h
+++ b/src/frontends/qt/GuiDocument.h
@@ -146,6 +146,7 @@ private Q_SLOTS:
 	void browseMaster();
 	void classChanged();
 	void classChanged_adaptor();
+	void colorlinksCB_adaptor(bool);
 	void languagePackageChanged(int);
 	void biblioChanged();
 	void rescanBibFiles();
diff --git a/src/frontends/qt/ui/PDFSupportUi.ui b/src/frontends/qt/ui/PDFSupportUi.ui
index b3ea170e31..df274ebd24 100644
--- a/src/frontends/qt/ui/PDFSupportUi.ui
+++ b/src/frontends/qt/ui/PDFSupportUi.ui
@@ -281,6 +281,9 @@
             </item>
             <item>
              <widget class="QCheckBox" name="colorlinksCB">
+              <property name="toolTip">
+               <string>Mutually exclusive with frames around links, see manual.</string>
+              </property>
               <property name="text">
                <string>C&olor links</string>
               </property>


More information about the lyx-cvs mailing list