diff --git a/theme.cpp b/theme.cpp index 06a455f83..a6b5b43e2 100644 --- a/theme.cpp +++ b/theme.cpp @@ -19,6 +19,7 @@ #include "theme.h" +#include #include #include @@ -164,6 +165,18 @@ QColor Theme::textColor() const return colors.foreground(KColorScheme::NormalText).color(); } +QFont Theme::font() const +{ + //TODO: allow this to be overridden with a plasma specific font? + return QApplication::font(); +} + +QFontMetrics Theme::fontMetrics() const +{ + //TODO: allow this to be overridden with a plasma specific font? + return QApplication::fontMetrics(); +} + } #include diff --git a/theme.h b/theme.h index bb03343a4..8621a9a5e 100644 --- a/theme.h +++ b/theme.h @@ -21,6 +21,8 @@ #define PLASMA_THEME_H #include +#include +#include #include @@ -101,6 +103,16 @@ class PLASMA_EXPORT Theme : public QObject */ Q_INVOKABLE QColor textColor() const; + /** + * Returns the font to be used by themed items + */ + Q_INVOKABLE QFont font() const; + + /** + * Returns the font metrics for the font to be used by themed items + */ + Q_INVOKABLE QFontMetrics fontMetrics() const; + Q_SIGNALS: /** * Emitted when the user changes the theme. SVGs should be reloaded at