X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fuistyle.h;fp=src%2Fuisupport%2Fuistyle.h;h=008577d21a3ee6163b59c55e7e09e08fb1025cd3;hp=899ab9a71ad34b370eb457ae7a98ecebcde0478a;hb=4171bdf884b6bbc7dad85f100a29746bf955191f;hpb=09e964ea3cd4995374dd7adb33256f3cefd47032 diff --git a/src/uisupport/uistyle.h b/src/uisupport/uistyle.h index 899ab9a7..008577d2 100644 --- a/src/uisupport/uistyle.h +++ b/src/uisupport/uistyle.h @@ -41,6 +41,7 @@ class UiStyle : public QObject { Q_OBJECT + Q_ENUMS(SenderPrefixModes) public: UiStyle(QObject *parent = 0); @@ -162,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; @@ -305,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 @@ -335,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; @@ -413,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)