X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fuisupport%2Fuistyle.h;h=008577d21a3ee6163b59c55e7e09e08fb1025cd3;hb=4171bdf884b6bbc7dad85f100a29746bf955191f;hp=35d9eeeba05a0844fffff998219ecf9486a4d3d8;hpb=374bb1f45bed3d21ad9abd7343bf0d2fc8a56fbc;p=quassel.git diff --git a/src/uisupport/uistyle.h b/src/uisupport/uistyle.h index 35d9eeeb..008577d2 100644 --- a/src/uisupport/uistyle.h +++ b/src/uisupport/uistyle.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2016 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -41,6 +41,7 @@ class UiStyle : public QObject { Q_OBJECT + Q_ENUMS(SenderPrefixModes) public: UiStyle(QObject *parent = 0); @@ -81,6 +82,7 @@ public: Bold = 0x00000100, Italic = 0x00000200, Underline = 0x00000400, + Strikethrough = 0x00000800, // Individual parts of a message Timestamp = 0x00001000, @@ -161,6 +163,15 @@ public: NumRoles // must be last! }; + /// Display of sender prefix modes + enum class SenderPrefixMode { + NoModes = 0, ///< Hide sender modes + HighestMode = 1, ///< Show the highest active sender mode + AllModes = 2 ///< Show all active sender modes + }; + // Do not change SenderPrefixMode numbering without also adjusting + // ChatViewSettingsPage::initSenderPrefixComboBox() and chatviewsettingspage.ui "defaultValue" + struct Format { FormatType type; QColor foreground; @@ -304,11 +315,11 @@ protected: */ static void setTimestampFormatString(const QString &format); /** - * Updates the local setting cache of whether or not to show sender prefixmodes + * Updates the local setting cache of how to display sender prefix modes * - * @param[in] enabled If true, sender prefixmodes are enabled, otherwise false. + * @param[in] mode Display format for sender prefix modes */ - static void enableSenderPrefixes(bool enabled); + static void setSenderPrefixDisplay(UiStyle::SenderPrefixMode mode); /** * Updates the local setting cache of whether or not to show sender brackets @@ -334,7 +345,7 @@ private: static bool _useCustomTimestampFormat; /// If true, use the custom timestamp format static QString _systemTimestampFormatString; /// Cached copy of system locale timestamp format static QString _timestampFormatString; /// Timestamp format string - static bool _showSenderPrefixes; /// If true, show prefixmodes before sender names + static UiStyle::SenderPrefixMode _senderPrefixDisplay; /// Display of prefix modes before sender static bool _showSenderBrackets; /// If true, show brackets around sender names QIcon _channelJoinedIcon; @@ -412,3 +423,4 @@ QDataStream &operator>>(QDataStream &in, UiStyle::FormatList &formatList); Q_DECLARE_METATYPE(UiStyle::FormatList) Q_DECLARE_METATYPE(UiStyle::MessageLabel) +Q_DECLARE_METATYPE(UiStyle::SenderPrefixMode)