]> git.lyx.org Git - features.git/commitdiff
Further amendment to 72a488d7
authorEnrico Forestieri <forenr@lyx.org>
Mon, 20 Mar 2017 22:59:16 +0000 (23:59 +0100)
committerEnrico Forestieri <forenr@lyx.org>
Mon, 20 Mar 2017 23:04:08 +0000 (00:04 +0100)
Rephrase positively the check box for the output of en- and em-dashes
and disable it when using non-TeX fonts. The state of the check box
is remembered, so that toggling the non-TeX fonts check box does not
cause information loss.

lib/RELEASE-NOTES
src/frontends/qt4/GuiDocument.cpp
src/frontends/qt4/GuiDocument.h
src/frontends/qt4/ui/FontUi.ui

index 9264e590ffa6dc101b2bf663fab61d39c93e90af..496d0a91d3a3ef445360327b88b301c3eef730d6 100644 (file)
 
 !!Caveats when upgrading from earlier versions to 2.3.x
 
-* If the "Use non-TeX fonts" and "Don't use ligatures for en- and em-dashes"
-  document preferences are not checked, when exporting documents containing
-  en- and em-dashes to the format of LyX 2.0 or earlier, the following line
-  has to be manually added to the unicodesymbols file of that LyX version:<br>
+* If using TeX fonts and en- and em-dashes are output as font ligatures,
+  when exporting documents containing en- and em-dashes to the format of
+  LyX 2.0 or earlier, the following line has to be manually added to the
+  unicodesymbols file of that LyX version:<br>
   0x200b "\\hspace{0pt}" "" "" "" "" # ZERO WIDTH SPACE<br>
   This avoids "uncodable character" issues if the document is actually
   loaded by that LyX version. LyX 2.1 and later versions already have the
index 01a5eddae236051099f4c00b69cf59df44924fb7..d13f8c4622e6b0209cd2adb9dcf95554211a36c4 100644 (file)
@@ -840,6 +840,8 @@ GuiDocument::GuiDocument(GuiView & lv)
                this, SLOT(change_adaptor()));
        connect(fontModule->dashesCB, SIGNAL(clicked()),
                this, SLOT(change_adaptor()));
+       connect(fontModule->dashesCB, SIGNAL(toggled(bool)),
+               this, SLOT(dashesToggled(bool)));
        connect(fontModule->scaleSansSB, SIGNAL(valueChanged(int)),
                this, SLOT(change_adaptor()));
        connect(fontModule->scaleTypewriterSB, SIGNAL(valueChanged(int)),
@@ -1936,6 +1938,13 @@ void GuiDocument::fontScToggled(bool state)
 }
 
 
+void GuiDocument::dashesToggled(bool state)
+{
+       if (!fontModule->osFontsCB->isChecked())
+               fontModule->dashesCB->setChecked(state);
+}
+
+
 void GuiDocument::updateFontOptions()
 {
        bool const tex_fonts = !fontModule->osFontsCB->isChecked();
@@ -1957,6 +1966,7 @@ void GuiDocument::updateFontOptions()
                                fontModule->fontsRomanCO->currentIndex()).toString();
        fontModule->fontScCB->setEnabled(providesSC(font));
        fontModule->fontOsfCB->setEnabled(providesOSF(font));
+       fontModule->dashesCB->setEnabled(tex_fonts);
        updateMathFonts(font);
 }
 
@@ -3048,7 +3058,7 @@ void GuiDocument::applyView()
                fromqstr(fontModule->cjkFontLE->text());
 
        bp_.use_microtype = fontModule->microtypeCB->isChecked();
-       bp_.use_dash_ligatures = !fontModule->dashesCB->isChecked();
+       bp_.use_dash_ligatures = fontModule->dashesCB->isChecked();
 
        bp_.fonts_sans_scale[nontexfonts] = fontModule->scaleSansSB->value();
        bp_.fonts_sans_scale[!nontexfonts] = fontModule->font_sf_scale;
@@ -3553,7 +3563,7 @@ void GuiDocument::paramsToDialog()
                fontModule->cjkFontLE->setText(QString());
        
        fontModule->microtypeCB->setChecked(bp_.use_microtype);
-       fontModule->dashesCB->setChecked(!bp_.use_dash_ligatures);
+       fontModule->dashesCB->setChecked(bp_.use_dash_ligatures);
 
        fontModule->fontScCB->setChecked(bp_.fonts_expert_sc);
        fontModule->fontOsfCB->setChecked(bp_.fonts_old_figures);
index e202bd95e087fbe26f6813ac56712646336cf65d..bb1b2f4c373fb728eb0554739f9474dfc82d786e 100644 (file)
@@ -105,6 +105,7 @@ private Q_SLOTS:
        void ttChanged(int);
        void fontOsfToggled(bool state);
        void fontScToggled(bool state);
+       void dashesToggled(bool state);
        void setIndent(int);
        void enableIndent(bool);
        void setSkip(int);
index 3877b376270dfb7983bec270dfb30163d792b7c3..b183331f28040cd1aea736dcfa106d7c3afad468 100644 (file)
    <item row="11" column="1">
     <widget class="QCheckBox" name="dashesCB">
      <property name="toolTip">
-      <string>Use \textendash and \textemdash instead of -- and --- for en- and em-dashes</string>
+      <string>Use font ligatures -- and --- instead of \textendash and \textemdash for en- and em-dashes</string>
      </property>
      <property name="text">
-      <string>Don't use ligatures for en- and &amp;em-dashes</string>
+      <string>Output en- and &amp;em-dashes as ligatures</string>
      </property>
     </widget>
    </item>