X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fqtuistyle.cpp;h=d1b455d09e3fde7cd57fe6f0718fb305babb4d55;hb=edacd25bf9957dddf6c4151f694728443dc5463a;hp=8c9f5dc0e916af34515d9f8ea162912077787726;hpb=dfbd0465f2a58eee4771472afd261869e5e5c400;p=quassel.git diff --git a/src/qtui/qtuistyle.cpp b/src/qtui/qtuistyle.cpp index 8c9f5dc0..d1b455d0 100644 --- a/src/qtui/qtuistyle.cpp +++ b/src/qtui/qtuistyle.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-08 by the Quassel Project * + * Copyright (C) 2005-09 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -19,8 +19,9 @@ ***************************************************************************/ #include "qtuistyle.h" +#include "qtuisettings.h" -QtUiStyle::QtUiStyle() : UiStyle("QtUiStyleNew") { // FIXME QtUiStyleNew naming +QtUiStyle::QtUiStyle() : UiStyle("QtUiStyle") { // We need to just set our internal formats; everything else is done by the base class... // Internal message formats @@ -74,11 +75,46 @@ QtUiStyle::QtUiStyle() : UiStyle("QtUiStyleNew") { // FIXME QtUiStyleNew naming ts.setForeground(QBrush("grey")); setFormat(Timestamp, ts, Settings::Default); + // Set the default sender color QTextCharFormat sender; sender.setAnchor(true); sender.setForeground(QBrush("navy")); setFormat(Sender, sender, Settings::Default); + /* + * Fillup the list of colors used for sender auto coloring In this case + * this are all tango colors without the grey tones + * See "http://tango.freedesktop.org/Tango_Icon_Theme_Guidelines" for details + */ + // Butter + addSenderAutoColor(SenderCol01, "#fce94f"); + addSenderAutoColor(SenderCol02, "#edd400"); + addSenderAutoColor(SenderCol03, "#c4a000"); + // Orange + addSenderAutoColor(SenderCol04, "#fcaf3e"); + addSenderAutoColor(SenderCol05, "#f57900"); + addSenderAutoColor(SenderCol06, "#ce5c00"); + // Chocolate + addSenderAutoColor(SenderCol07, "#e9b96e"); + addSenderAutoColor(SenderCol08, "#c17d11"); + addSenderAutoColor(SenderCol09, "#8f5902"); + // Chameleon + addSenderAutoColor(SenderCol10, "#8ae234"); + addSenderAutoColor(SenderCol11, "#73d216"); + addSenderAutoColor(SenderCol12, "#4e9a06"); + // Sky Blue + addSenderAutoColor(SenderCol13, "#729fcf"); + addSenderAutoColor(SenderCol14, "#3465a4"); + addSenderAutoColor(SenderCol15, "#204a87"); + // Plum + addSenderAutoColor(SenderCol16, "#ad7fa8"); + addSenderAutoColor(SenderCol17, "#75507b"); + addSenderAutoColor(SenderCol18, "#5c3566"); + // Scarlet Red + addSenderAutoColor(SenderCol19, "#ef2929"); + addSenderAutoColor(SenderCol20, "#cc0000"); + addSenderAutoColor(SenderCol21, "#a40000"); + QTextCharFormat nick; nick.setAnchor(true); nick.setFontWeight(QFont::Bold); @@ -102,7 +138,23 @@ QtUiStyle::QtUiStyle() : UiStyle("QtUiStyleNew") { // FIXME QtUiStyleNew naming url.setAnchor(true); setFormat(Url, url, Settings::Default); - + QtUiStyleSettings s; + _highlightColor = s.highlightColor(); + if(!_highlightColor.isValid()) _highlightColor = QColor("lightcoral"); } QtUiStyle::~QtUiStyle() {} + +void QtUiStyle::setHighlightColor(const QColor &col) { + _highlightColor = col; + QtUiStyleSettings s; + s.setHighlightColor(col); +} + +void QtUiStyle::addSenderAutoColor(FormatType type, const QString name) +{ + QTextCharFormat autoColor; + autoColor.setAnchor(true); + autoColor.setForeground(QBrush(QColor(name))); + setFormat(type, autoColor, Settings::Default); +}