From 34bd2b87b20a029ec2be83085da6f542c1469224 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Wed, 19 Dec 2007 19:56:39 +0000 Subject: [PATCH] font accessors for the theme svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=750643 --- theme.cpp | 13 +++++++++++++ theme.h | 12 ++++++++++++ 2 files changed, 25 insertions(+) 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