mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-23 15:06:32 +00:00
Respect font scale for fixed-width fonts
This commit is contained in:
@@ -2075,8 +2075,10 @@ int Formatter::m_minFigures = 2, Formatter::m_maxFigures = 5, Formatter::m_expNe
|
||||
double Formatter::m_expNegValue = 0.00001; // 10^(-5)
|
||||
double Formatter::m_expPosValue = 10000000.0; // 10^7
|
||||
QFont *Formatter::m_Font = NULL;
|
||||
QFont *Formatter::m_FixedFont = NULL;
|
||||
float Formatter::m_FontBaseSize = 10.0f; // this should always be overridden below, but just in
|
||||
// case let's pick a sensible value
|
||||
float Formatter::m_FixedFontBaseSize = 10.0f;
|
||||
QColor Formatter::m_DarkChecker, Formatter::m_LightChecker;
|
||||
|
||||
void Formatter::setParams(const PersistantConfig &config)
|
||||
@@ -2093,6 +2095,8 @@ void Formatter::setParams(const PersistantConfig &config)
|
||||
{
|
||||
m_Font = new QFont();
|
||||
m_FontBaseSize = QApplication::font().pointSizeF();
|
||||
m_FixedFont = new QFont(QFontDatabase::systemFont(QFontDatabase::FixedFont));
|
||||
m_FixedFontBaseSize = m_FixedFont->pointSizeF();
|
||||
}
|
||||
|
||||
*m_Font =
|
||||
@@ -2103,6 +2107,8 @@ void Formatter::setParams(const PersistantConfig &config)
|
||||
f.setPointSizeF(m_FontBaseSize * config.Font_GlobalScale);
|
||||
QApplication::setFont(f);
|
||||
|
||||
m_FixedFont->setPointSizeF(m_FixedFontBaseSize * config.Font_GlobalScale);
|
||||
|
||||
Formatter::setPalette(QApplication::palette());
|
||||
}
|
||||
|
||||
|
||||
@@ -256,13 +256,14 @@ struct Formatter
|
||||
static QString Format(int32_t i, bool hex = false) { return QString::number(i); }
|
||||
static QString Format(int64_t i, bool hex = false) { return QString::number(i); }
|
||||
static const QFont &PreferredFont() { return *m_Font; }
|
||||
static const QFont &FixedFont() { return *m_FixedFont; }
|
||||
static const QColor DarkCheckerColor() { return m_DarkChecker; }
|
||||
static const QColor LightCheckerColor() { return m_LightChecker; }
|
||||
private:
|
||||
static int m_minFigures, m_maxFigures, m_expNegCutoff, m_expPosCutoff;
|
||||
static double m_expNegValue, m_expPosValue;
|
||||
static QFont *m_Font;
|
||||
static float m_FontBaseSize;
|
||||
static QFont *m_Font, *m_FixedFont;
|
||||
static float m_FontBaseSize, m_FixedFontBaseSize;
|
||||
static QColor m_DarkChecker, m_LightChecker;
|
||||
};
|
||||
|
||||
|
||||
@@ -245,7 +245,6 @@ void ConfigureSyntax(ScintillaEdit *scintilla, int language)
|
||||
}
|
||||
|
||||
scintilla->setLexer(language);
|
||||
scintilla->styleSetSize(STYLE_DEFAULT, 10);
|
||||
|
||||
#define SC_COL(qcol) SCINTILLA_COLOUR(qcol.red(), qcol.green(), qcol.blue())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user