X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fuistyle.cpp;h=94c9742bef3b9e57042922eb82cddca07006cb63;hp=79f23c6727d56e53015b9e94d1fa371270defdbb;hb=2a60e60bdfd1ab26cea1ae68d5a8cf3bfb223d70;hpb=682c6e31834a863c4c78b6dfd5f830c72a6b665d diff --git a/src/uisupport/uistyle.cpp b/src/uisupport/uistyle.cpp index 79f23c67..94c9742b 100644 --- a/src/uisupport/uistyle.cpp +++ b/src/uisupport/uistyle.cpp @@ -17,6 +17,7 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#include #include "uistyle.h" #include "uistylesettings.h" @@ -25,7 +26,8 @@ UiStyle::UiStyle(const QString &settingsKey) : _settingsKey(settingsKey) { // Default format QTextCharFormat def; def.setForeground(QBrush("#000000")); - //def.setFont(QFont("Courier", 10)); + def.setFont(QFont("Monospace", QApplication::font().pointSize())); + def.font().setFixedPitch(true); def.font().setStyleHint(QFont::TypeWriter); _defaultFormats = QVector(NumFormatTypes, def); _customFormats = QVector(NumFormatTypes, QTextFormat().toCharFormat()); @@ -130,9 +132,7 @@ QString UiStyle::formatCode(FormatType ftype) const { } UiStyle::StyledText UiStyle::styleString(const QString &_s) { - QString s = _s; // we can't use call-by-value since this seems to maybe screw up Qt's implicit sharing somehow - // at least invalid formats are created if we do that - if(s.startsWith(" ")) {}; // and yet some other stupid no-op that seems to fix the font issue on some machines... -_- + QString s = _s; StyledText result; QList fmtList; fmtList.append(None); @@ -240,5 +240,3 @@ QTextCharFormat UiStyle::mergedFormat(QList formatList) { } return fmt; } - -