Commit 5c610f97 authored by Don Gagne's avatar Don Gagne

Added medium and large default font sizes

parent fb473fe7
......@@ -31,6 +31,8 @@
#include <QFontMetrics>
const double ScreenTools::_defaultFontPointSize = 13;
const double ScreenTools::_mediumFontPointSize = 16;
const double ScreenTools::_largeFontPointSize = 20;
ScreenTools::ScreenTools()
{
......@@ -92,7 +94,7 @@ void ScreenTools::_updatePixelSize()
void ScreenTools::_updateFontSize()
{
emit fontPointFactorChanged();
emit defaultFontPointSizeChanged();
emit fontSizesChanged();
}
double ScreenTools::fontPointFactor()
......@@ -109,3 +111,13 @@ double ScreenTools::defaultFontPointSize(void)
{
return _defaultFontPointSize * MainWindow::fontPointFactor();
}
double ScreenTools::mediumFontPointSize(void)
{
return _mediumFontPointSize * MainWindow::fontPointFactor();
}
double ScreenTools::largeFontPointSize(void)
{
return _largeFontPointSize * MainWindow::fontPointFactor();
}
......@@ -85,8 +85,13 @@ public:
Q_PROPERTY(double fontPointFactor READ fontPointFactor NOTIFY fontPointFactorChanged)
//! Returns the pixel size factor
Q_PROPERTY(double pixelSizeFactor READ pixelSizeFactor NOTIFY pixelSizeFactorChanged)
//! Returns the system wide default font point size (properly scaled)
Q_PROPERTY(double defaultFontPointSize READ defaultFontPointSize NOTIFY defaultFontPointSizeChanged)
Q_PROPERTY(double defaultFontPointSize READ defaultFontPointSize NOTIFY fontSizesChanged)
//! Returns the system wide default font point size (properly scaled)
Q_PROPERTY(double mediumFontPointSize READ mediumFontPointSize NOTIFY fontSizesChanged)
//! Returns the system wide default font point size (properly scaled)
Q_PROPERTY(double largeFontPointSize READ largeFontPointSize NOTIFY fontSizesChanged)
//! Utility for adjusting font point size. Not dynamic (no signals)
Q_INVOKABLE qreal adjustFontPointSize(qreal pointSize);
......@@ -113,6 +118,8 @@ public:
double fontPointFactor ();
double pixelSizeFactor ();
double defaultFontPointSize(void);
double mediumFontPointSize(void);
double largeFontPointSize(void);
#if defined (__android__)
bool isAndroid () { return true; }
......@@ -128,7 +135,7 @@ signals:
void repaintRequestedChanged();
void pixelSizeFactorChanged();
void fontPointFactorChanged();
void defaultFontPointSizeChanged();
void fontSizesChanged();
private slots:
void _updateCanvas();
......@@ -137,7 +144,8 @@ private slots:
private:
static const double _defaultFontPointSize;
static const double _mediumFontPointSize;
static const double _largeFontPointSize;
};
#endif
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