summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2012-03-07 08:56:41 +0100
committerQt by Nokia <qt-info@nokia.com>2012-03-07 12:43:32 +0100
commit83cabda862dced9477d155c84df9440047c856cf (patch)
tree9f39de378bfeed923d2a35e433481e4da1dc0f32 /src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
parent7439fb47cd7c5731dd1aadeaf10c46b58aa59798 (diff)
Add fonts to QPlatformTheme.
- Remove QPlatformFontDatabase::defaultFonts() returning a hash containing widget name ->font and the Windows implementation. - Add enumeration and font accessor to QPlatformTheme. The value returned for the enumeration value overwrites the default font of the font database. - Implement for Windows, Mac and KDE. - Add more Windows palettes. Task-number: QTBUG-23686 Change-Id: I8a2abdfd216df23daa7c9630c54264cdf61295db Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Diffstat (limited to 'src/platformsupport/themes/genericunix/qgenericunixthemes_p.h')
-rw-r--r--src/platformsupport/themes/genericunix/qgenericunixthemes_p.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h b/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
index 12937a205f..a9db29e8cd 100644
--- a/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
+++ b/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
@@ -50,6 +50,18 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
+class ResourceHelper
+{
+public:
+ ResourceHelper();
+ ~ResourceHelper() { clear(); }
+
+ void clear();
+
+ QPalette *palettes[QPlatformTheme::NPalettes];
+ QFont *fonts[QPlatformTheme::NFonts];
+};
+
class QGenericUnixTheme : public QPlatformTheme
{
public:
@@ -66,21 +78,24 @@ class QKdeTheme : public QPlatformTheme
{
QKdeTheme(const QString &kdeHome, int kdeVersion);
public:
- ~QKdeTheme() { clearPalettes(); }
static QPlatformTheme *createKdeTheme();
virtual QVariant themeHint(ThemeHint hint) const;
+
virtual const QPalette *palette(Palette type = SystemPalette) const
- { return m_palettes[type]; }
+ { return m_resources.palettes[type]; }
+
+ virtual const QFont *font(Font type) const
+ { return m_resources.fonts[type]; }
private:
QString globalSettingsFile() const;
- void clearPalettes();
void refresh();
const QString m_kdeHome;
const int m_kdeVersion;
- QPalette *m_palettes[NPalettes];
+
+ ResourceHelper m_resources;
QString m_iconThemeName;
QString m_iconFallbackThemeName;
QStringList m_styleNames;