]> git.lyx.org Git - features.git/commitdiff
8-char tab stops are too big in the preamble editor.
authorRichard Heck <rgheck@lyx.org>
Mon, 2 Apr 2018 02:07:21 +0000 (22:07 -0400)
committerRichard Heck <rgheck@lyx.org>
Mon, 2 Apr 2018 02:07:21 +0000 (22:07 -0400)
src/frontends/qt4/GuiDocument.cpp

index 3f2c89893563e6c91fa9549d6698b7d76723d7cd..7fd6007c5c22c214c46081a553faf454291ad1f4 100644 (file)
@@ -473,6 +473,10 @@ PreambleModule::PreambleModule(QWidget * parent)
        connect(findButtonPB, SIGNAL(clicked()), this, SLOT(findText()));
        connect(findLE, SIGNAL(returnPressed()), this, SLOT(findText()));
        checkFindButton();
+       // https://stackoverflow.com/questions/13027091/how-to-override-tab-width-in-qt
+       const int tabStop = 4;
+       QFontMetrics metrics(preambleTE->currentFont());
+       preambleTE->setTabStopWidth(tabStop * metrics.width(' '));
 }