projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Correctly handle the font property "underline"
[quassel.git]
/
src
/
uisupport
/
uistyle.h
diff --git
a/src/uisupport/uistyle.h
b/src/uisupport/uistyle.h
index
a163809
..
9b9365d
100644
(file)
--- a/
src/uisupport/uistyle.h
+++ b/
src/uisupport/uistyle.h
@@
-32,11
+32,11
@@
#include "message.h"
#include "settings.h"
#include "message.h"
#include "settings.h"
-class UiStyle {
- Q_
DECLARE_TR_FUNCTIONS(UiStyle)
+class UiStyle
: public QObject
{
+ Q_
OBJECT
public:
public:
- UiStyle();
+ UiStyle(
QObject *parent = 0
);
virtual ~UiStyle();
typedef QList<QPair<quint16, quint32> > FormatList;
virtual ~UiStyle();
typedef QList<QPair<quint16, quint32> > FormatList;
@@
-77,10
+77,11
@@
public:
// Individual parts of a message
Timestamp = 0x00000100,
Sender = 0x00000200,
// Individual parts of a message
Timestamp = 0x00000100,
Sender = 0x00000200,
- Nick = 0x00000400,
- Hostmask = 0x00000800,
- ChannelName = 0x00001000,
- ModeFlags = 0x00002000,
+ Contents = 0x00000400,
+ Nick = 0x00000800,
+ Hostmask = 0x00001000,
+ ChannelName = 0x00002000,
+ ModeFlags = 0x00004000,
// URL is special, we want that to take precedence over the rest...
Url = 0x00080000
// URL is special, we want that to take precedence over the rest...
Url = 0x00080000
@@
-111,14
+112,16
@@
public:
inline QFont defaultFont() const { return _defaultFont; }
inline QFont defaultFont() const { return _defaultFont; }
- QList<QTextLayout::FormatRange> toTextLayoutList(const FormatList &, int textLength);
+ QList<QTextLayout::FormatRange> toTextLayoutList(const FormatList &, int textLength
, quint32 messageLabel = 0
);
-p
rotected
:
+p
ublic slots
:
void loadStyleSheet();
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;
QTextCharFormat cachedFormat(quint64 key) const;
QTextCharFormat cachedFormat(quint32 formatType, quint32 messageLabel = 0) const;
@@
-147,6
+150,9
@@
public:
inline FormatType timestampFormat() const { return UiStyle::Timestamp; }
FormatType senderFormat() const;
const FormatList &contentsFormatList() const;
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;
protected:
//! Styling is only needed for calls to plainContents() and contentsFormatList()
void style() const;
@@
-154,6
+160,7
@@
protected:
private:
mutable StyledString _contents;
private:
mutable StyledString _contents;
+ mutable quint8 _senderHash;
};
QDataStream &operator<<(QDataStream &out, const UiStyle::FormatList &formatList);
};
QDataStream &operator<<(QDataStream &out, const UiStyle::FormatList &formatList);