Update ChatViews whenever the stylesheet is reloaded
[quassel.git] / src / uisupport / uistyle.h
index 98e15ed..9b9365d 100644 (file)
 #include "message.h"
 #include "settings.h"
 
-class UiStyle {
-  Q_DECLARE_TR_FUNCTIONS(UiStyle)
+class UiStyle : public QObject{
+  Q_OBJECT
 
 public:
-  UiStyle();
+  UiStyle(QObject *parent = 0);
   virtual ~UiStyle();
 
   typedef QList<QPair<quint16, quint32> > FormatList;
@@ -103,8 +103,6 @@ public:
 
   class StyledMessage;
 
-  void loadStyleSheet();
-
   static FormatType formatType(Message::Type msgType);
   static StyledString styleString(const QString &string, quint32 baseFormat = None);
   static QString mircToInternal(const QString &);
@@ -116,6 +114,12 @@ public:
 
   QList<QTextLayout::FormatRange> toTextLayoutList(const FormatList &, int textLength, quint32 messageLabel = 0);
 
+public slots:
+  void loadStyleSheet();
+
+signals:
+  void changed();
+
 protected:
   QString loadStyleSheet(const QString &name, bool shouldExist = false);