Commit ff56426e authored by Don Gagne's avatar Don Gagne

Add dpi adjusted font sizes

parent 514a4d95
......@@ -25,10 +25,13 @@
/// @author Don Gagne <don@thegagnes.com>
#include "QGCPalette.h"
#include "ScreenTools.h"
#include <QApplication>
#include <QPalette>
const qreal QGCPalette::_defaultFontPointSize = 12;
QList<QGCPalette*> QGCPalette::_paletteObjects;
QGCPalette::Theme QGCPalette::_theme = QGCPalette::Dark;
......@@ -130,3 +133,8 @@ void QGCPalette::_themeChanged(void)
{
emit paletteChanged();
}
qreal QGCPalette::dpiAdjustedDefaultFontPointSize(void)
{
return ScreenTools::dpiAdjustedPointSize_s(_defaultFontPointSize);
}
......@@ -82,7 +82,11 @@ class QGCPalette : public QObject
// Text color for TextFields
Q_PROPERTY(QColor textFieldText READ textFieldText NOTIFY paletteChanged)
Q_PROPERTY(qreal defaultFontPointSize MEMBER _defaultFontPointSize CONSTANT)
Q_PROPERTY(qreal dpiAdjustedDefaultFontPointSize READ dpiAdjustedDefaultFontPointSize CONSTANT)
public:
enum ColorGroup {
Disabled = 0,
......@@ -120,6 +124,8 @@ public:
static Theme globalTheme(void) { return _theme; }
static void setGlobalTheme(Theme newTheme);
qreal dpiAdjustedDefaultFontPointSize(void);
signals:
void paletteChanged(void);
......@@ -149,6 +155,8 @@ private:
static QColor _textField[_cThemes][_cColorGroups];
static QColor _textFieldText[_cThemes][_cColorGroups];
static const qreal _defaultFontPointSize;
void _themeChanged(void);
static QList<QGCPalette*> _paletteObjects; ///< List of all active QGCPalette objects
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment