1 /***************************************************************************
2 * Copyright (C) 2005-08 by the Quassel Project *
3 * devel@quassel-irc.org *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) version 3. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
21 #include "qtuistyle.h"
22 #include "qtuisettings.h"
24 QtUiStyle::QtUiStyle() : UiStyle("QtUiStyle") {
25 // We need to just set our internal formats; everything else is done by the base class...
27 // Internal message formats
28 QTextCharFormat plainMsg;
29 plainMsg.setForeground(QBrush("black"));
30 setFormat(PlainMsg, plainMsg, Settings::Default);
32 QTextCharFormat notice;
33 notice.setForeground(QBrush("navy"));
34 setFormat(NoticeMsg, notice, Settings::Default);
36 QTextCharFormat server;
37 server.setForeground(QBrush("navy"));
38 setFormat(ServerMsg, server, Settings::Default);
40 QTextCharFormat error;
41 error.setForeground(QBrush("red"));
42 setFormat(ErrorMsg, error, Settings::Default);
45 join.setForeground(QBrush("green"));
46 setFormat(JoinMsg, join, Settings::Default);
49 part.setForeground(QBrush("indianred"));
50 setFormat(PartMsg, part, Settings::Default);
53 quit.setForeground(QBrush("indianred"));
54 setFormat(QuitMsg, quit, Settings::Default);
57 kick.setForeground(QBrush("indianred"));
58 setFormat(KickMsg, kick, Settings::Default);
61 nren.setForeground(QBrush("magenta"));
62 setFormat(RenameMsg, nren, Settings::Default);
65 mode.setForeground(QBrush("steelblue"));
66 setFormat(ModeMsg, mode, Settings::Default);
68 QTextCharFormat action;
69 action.setFontItalic(true);
70 action.setForeground(QBrush("darkmagenta"));
71 setFormat(ActionMsg, action, Settings::Default);
73 // Internal message element formats
75 ts.setForeground(QBrush("grey"));
76 setFormat(Timestamp, ts, Settings::Default);
78 QTextCharFormat sender;
79 sender.setAnchor(true);
80 sender.setForeground(QBrush("navy"));
81 setFormat(Sender, sender, Settings::Default);
85 nick.setFontWeight(QFont::Bold);
86 setFormat(Nick, nick, Settings::Default);
88 QTextCharFormat hostmask;
89 hostmask.setFontItalic(true);
90 setFormat(Hostmask, hostmask, Settings::Default);
92 QTextCharFormat channel;
93 channel.setAnchor(true);
94 channel.setFontWeight(QFont::Bold);
95 setFormat(ChannelName, channel, Settings::Default);
97 QTextCharFormat flags;
98 flags.setFontWeight(QFont::Bold);
99 setFormat(ModeFlags, flags, Settings::Default);
102 url.setFontUnderline(true);
104 setFormat(Url, url, Settings::Default);
107 _highlightColor = s.highlightColor();
108 if(!_highlightColor.isValid()) _highlightColor = QColor("lightcoral");
111 QtUiStyle::~QtUiStyle() {}
113 void QtUiStyle::setHighlightColor(const QColor &col) {
114 _highlightColor = col;
116 s.setHighlightColor(col);