]> git.lyx.org Git - lyx.git/commitdiff
PDF options: reflect in UI mutually exclusive colorlinks and frames.
authorPavel Sanda <sanda@lyx.org>
Mon, 30 Sep 2024 18:06:38 +0000 (20:06 +0200)
committerPavel Sanda <sanda@lyx.org>
Mon, 30 Sep 2024 18:09:35 +0000 (20:09 +0200)
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg222961.html

src/frontends/qt/GuiDocument.cpp
src/frontends/qt/GuiDocument.h
src/frontends/qt/ui/PDFSupportUi.ui

index 4eb945e1af0a40bcfc01020fb0a9f27802cb891a..a98680b9a51cb7c0c088d57efd666c9a6e7c9671 100644 (file)
@@ -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);
index 3e49fa663d2d0f1d6688ddc9740e8aa274aeecd5..8ff27f56709f08889c291349693af84ecb078e92 100644 (file)
@@ -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();
index b3ea170e31653dfbc4b8246f7fee7c340dcb01bc..df274ebd24c9e4e9447c0009514040477bdeca31 100644 (file)
             </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&amp;olor links</string>
               </property>