1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

relative to system wide default font sizes in css

This commit is contained in:
apprb 2014-10-06 23:39:07 +09:00
parent a85372a5c0
commit 6e02240b56
3 changed files with 19 additions and 15 deletions

View File

@ -23,6 +23,7 @@
#include <QRegularExpression>
#include <QWidget>
#include <QStyle>
#include <QFontInfo>
// helper functions
QFont appFont(int pixelSize, int weight)
@ -78,14 +79,17 @@ QFont Style::getFont(Style::Font font)
{
// fonts as defined in
// https://github.com/ItsDuke/Tox-UI/blob/master/UI%20GUIDELINES.md
static int defSize = QFontInfo(QFont()).pixelSize();
static QFont fonts[] = {
appFont(16, QFont::Bold),
appFont(14, QFont::Normal),
appFont(14, QFont::Bold),
appFont(13, QFont::Normal),
appFont(13, QFont::Bold),
appFont(12, QFont::Normal),
appFont(12, QFont::Light),
appFont(defSize + 2, QFont::Bold),
appFont(defSize , QFont::Normal),
appFont(defSize , QFont::Bold),
appFont(defSize - 1, QFont::Normal),
appFont(defSize - 1, QFont::Bold),
appFont(defSize - 2, QFont::Normal),
appFont(defSize - 2, QFont::Light),
};
return fonts[font];

View File

@ -41,13 +41,13 @@ public:
enum Font
{
ExtraBig, // 14px, bold
Big, // 12px
BigBold, // 12px, bold
Medium, // 11px
MediumBold, // 11px, bold
Small, // 10px
SmallLight // 10px, light
ExtraBig, // [SystemDefault + 2]px, bold
Big, // [SystemDefault ]px
BigBold, // [SystemDefault ]px, bold
Medium, // [SystemDefault - 1]px
MediumBold, // [SystemDefault - 1]px, bold
Small, // [SystemDefault - 2]px
SmallLight // [SystemDefault - 2]px, light
};
static QString getStylesheet(const QString& filename);

View File

@ -9,7 +9,7 @@
}
#statusPanel > #statusHead > #statusLabel {
font: @smallLight;
font: @medium;
color: @lightGrey;
}