From 85f31b1310c6084d841e5dba43eb4e7d4aa41e00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 9 Aug 2012 09:44:40 +0200 Subject: [PATCH] Honor the decoration font in Aurorae Adding two properties to the AuroraeFactory to read the active and inactive title font. BUG: 304791 FIXED-IN: 4.9.1 REVIEW: 105956 --- clients/aurorae/src/aurorae.cpp | 13 +++++++++++++ clients/aurorae/src/aurorae.h | 6 ++++++ clients/aurorae/src/qml/aurorae.qml | 1 + 3 files changed, 20 insertions(+) diff --git a/clients/aurorae/src/aurorae.cpp b/clients/aurorae/src/aurorae.cpp index c5283e8c4c..4277b65bef 100644 --- a/clients/aurorae/src/aurorae.cpp +++ b/clients/aurorae/src/aurorae.cpp @@ -85,6 +85,9 @@ bool AuroraeFactory::reset(unsigned long changed) if (changed & SettingButtons) { emit buttonsChanged(); } + if (changed & SettingFont){ + emit titleFontChanged(); + } const KConfig conf("auroraerc"); const KConfigGroup group(&conf, "Engine"); const QString themeName = group.readEntry("ThemeName", "example-deco"); @@ -161,6 +164,16 @@ bool AuroraeFactory::customButtonPositions() return options()->customButtonPositions(); } +QFont AuroraeFactory::activeTitleFont() +{ + return options()->font(); +} + +QFont AuroraeFactory::inactiveTitleFont() +{ + return options()->font(false); +} + AuroraeFactory *AuroraeFactory::s_instance = NULL; /******************************************************* diff --git a/clients/aurorae/src/aurorae.h b/clients/aurorae/src/aurorae.h index 46099134c1..fabd828ff3 100644 --- a/clients/aurorae/src/aurorae.h +++ b/clients/aurorae/src/aurorae.h @@ -41,6 +41,8 @@ class AuroraeFactory : public QObject, public KDecorationFactoryUnstable Q_PROPERTY(QString leftButtons READ leftButtons NOTIFY buttonsChanged) Q_PROPERTY(QString rightButtons READ rightButtons NOTIFY buttonsChanged) Q_PROPERTY(bool customButtonPositions READ customButtonPositions NOTIFY buttonsChanged) + Q_PROPERTY(QFont activeTitleFont READ activeTitleFont NOTIFY titleFontChanged) + Q_PROPERTY(QFont inactiveTitleFont READ inactiveTitleFont NOTIFY titleFontChanged) public: ~AuroraeFactory(); @@ -58,12 +60,16 @@ public: QString rightButtons(); bool customButtonPositions(); + QFont activeTitleFont(); + QFont inactiveTitleFont(); + private: AuroraeFactory(); void init(); Q_SIGNALS: void buttonsChanged(); + void titleFontChanged(); private: static AuroraeFactory *s_instance; diff --git a/clients/aurorae/src/qml/aurorae.qml b/clients/aurorae/src/qml/aurorae.qml index f1538736eb..633378b158 100644 --- a/clients/aurorae/src/qml/aurorae.qml +++ b/clients/aurorae/src/qml/aurorae.qml @@ -143,6 +143,7 @@ Decoration { elide: Text.ElideRight height: auroraeTheme.titleHeight color: decoration.active ? auroraeTheme.activeTextColor : auroraeTheme.inactiveTextColor + font: decoration.active ? options.activeTitleFont : options.inactiveTitleFont anchors { left: leftButtonGroup.right right: rightButtonGroup.left