X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fuistyle.h;h=9b9365d47b2f999beb8f0b45ef7f80c2f9b921ca;hp=5941515933fce8dca32cfb1026ab2559c2fe1d0e;hb=68cd9a2621c71005cda0ed4fb796bbf5fcbe007e;hpb=a507ecd831054ca9b3845985ae7ca3d33fad908d diff --git a/src/uisupport/uistyle.h b/src/uisupport/uistyle.h index 59415159..9b9365d4 100644 --- a/src/uisupport/uistyle.h +++ b/src/uisupport/uistyle.h @@ -32,11 +32,11 @@ #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 > FormatList; @@ -112,14 +112,16 @@ public: inline QFont defaultFont() const { return _defaultFont; } - QList toTextLayoutList(const FormatList &, int textLength); + QList toTextLayoutList(const FormatList &, int textLength, quint32 messageLabel = 0); -protected: +public slots: void loadStyleSheet(); - //! Determines the format set to be used for the given hostmask - //int formatSetIndex(const QString &hostmask) const; - //int formatSetIndexForSelf() const; +signals: + void changed(); + +protected: + QString loadStyleSheet(const QString &name, bool shouldExist = false); QTextCharFormat cachedFormat(quint64 key) const; QTextCharFormat cachedFormat(quint32 formatType, quint32 messageLabel = 0) const; @@ -148,6 +150,9 @@ public: inline FormatType timestampFormat() const { return UiStyle::Timestamp; } FormatType senderFormat() const; const FormatList &contentsFormatList() const; + + quint8 senderHash() const; + protected: //! Styling is only needed for calls to plainContents() and contentsFormatList() void style() const; @@ -155,6 +160,7 @@ protected: private: mutable StyledString _contents; + mutable quint8 _senderHash; }; QDataStream &operator<<(QDataStream &out, const UiStyle::FormatList &formatList);