185 this->notify = notify; |
185 this->notify = notify; |
186 |
186 |
187 m_isAdmin = false; |
187 m_isAdmin = false; |
188 m_autoKickEnabled = false; |
188 m_autoKickEnabled = false; |
189 |
189 |
190 { |
190 QStringList vpList = |
191 QStringList vpList = |
191 QStringList() << "Classic" << "Default" << "Mobster" << "Russian"; |
192 QStringList() << "Classic" << "Default" << "Mobster" << "Russian"; |
192 |
193 |
193 foreach (const QString & vp, vpList) |
194 foreach (QString vp, vpList) |
194 { |
195 { |
195 m_helloSounds.append(QString("/Sounds/voices/%1/Hello.ogg").arg(vp)); |
196 m_helloSounds.append(QString("physfs://Sounds/voices/%1/Hello.ogg").arg(vp)); |
196 } |
197 } |
197 |
198 |
198 m_hilightSound = "/Sounds/beep.ogg"; |
199 m_hilightSound = "physfs://Sounds/beep.ogg"; |
199 |
200 |
200 mainLayout.setMargin(0); |
201 } |
201 |
202 |
202 QWidget * leftSideContainer = new QWidget(); |
203 mainLayout.setSpacing(1); |
203 leftSideContainer->setObjectName("leftSideContainer"); |
204 mainLayout.setMargin(1); |
204 leftSideContainer->setStyleSheet("#leftSideContainer { border-width: 0px; background-color: #ffcc00; border-radius: 10px;} QTextBrowser, SmartLineEdit { background-color: rgb(13, 5, 68); }"); |
205 mainLayout.setSizeConstraint(QLayout::SetMinimumSize); |
205 QVBoxLayout * leftSide = new QVBoxLayout(leftSideContainer); |
206 mainLayout.setColumnStretch(0, 76); |
206 leftSide->setSpacing(3); |
207 mainLayout.setColumnStretch(1, 24); |
207 leftSide->setMargin(3); |
208 |
208 mainLayout.addWidget(leftSideContainer, 76); |
209 chatEditLine = new SmartLineEdit(this); |
209 |
210 chatEditLine->setMaxLength(300); |
210 // Chat view |
211 connect(chatEditLine, SIGNAL(returnPressed()), this, SLOT(returnPressed())); |
|
212 |
|
213 mainLayout.addWidget(chatEditLine, 2, 0); |
|
214 |
211 |
215 chatText = new QTextBrowser(this); |
212 chatText = new QTextBrowser(this); |
216 |
|
217 chatText->document()->setDefaultStyleSheet(styleSheet()); |
213 chatText->document()->setDefaultStyleSheet(styleSheet()); |
218 |
|
219 chatText->setMinimumHeight(20); |
214 chatText->setMinimumHeight(20); |
220 chatText->setMinimumWidth(10); |
215 chatText->setMinimumWidth(10); |
221 chatText->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
216 chatText->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
222 chatText->setOpenLinks(false); |
217 chatText->setOpenLinks(false); |
|
218 chatText->setStyleSheet("QTextBrowser { background-color: rgb(23, 11, 54); border-width: 0px; }"); |
223 connect(chatText, SIGNAL(anchorClicked(const QUrl&)), |
219 connect(chatText, SIGNAL(anchorClicked(const QUrl&)), |
224 this, SLOT(linkClicked(const QUrl&))); |
220 this, SLOT(linkClicked(const QUrl&))); |
225 mainLayout.addWidget(chatText, 0, 0, 2, 1); |
221 leftSide->addWidget(chatText, 1); |
|
222 |
|
223 // Input box |
|
224 |
|
225 // Normal: rgb(23, 11, 54) |
|
226 // Hover: rgb(13, 5, 68) |
|
227 |
|
228 chatEditLine = new SmartLineEdit(); |
|
229 chatEditLine->setMaxLength(300); |
|
230 chatEditLine->setStyleSheet("SmartLineEdit { background-color: rgb(23, 11, 54); padding: 2px 8px; border-width: 0px; border-radius: 7px; } SmartLineEdit:hover, SmartLineEdit:focus { background-color: rgb(13, 5, 68); }"); |
|
231 chatEditLine->setFixedHeight(24); |
|
232 chatEditLine->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
|
233 connect(chatEditLine, SIGNAL(returnPressed()), this, SLOT(returnPressed())); |
|
234 |
|
235 leftSide->addWidget(chatEditLine, 0); |
|
236 |
|
237 // Nickname list |
226 |
238 |
227 chatNicks = new QListView(this); |
239 chatNicks = new QListView(this); |
228 chatNicks->setIconSize(QSize(24, 16)); |
240 chatNicks->setIconSize(QSize(24, 16)); |
229 chatNicks->setSelectionMode(QAbstractItemView::SingleSelection); |
241 chatNicks->setSelectionMode(QAbstractItemView::SingleSelection); |
230 chatNicks->setEditTriggers(QAbstractItemView::NoEditTriggers); |
242 chatNicks->setEditTriggers(QAbstractItemView::NoEditTriggers); |
236 connect(chatNicks, SIGNAL(doubleClicked(QModelIndex)), |
248 connect(chatNicks, SIGNAL(doubleClicked(QModelIndex)), |
237 this, SLOT(chatNickDoubleClicked(QModelIndex))); |
249 this, SLOT(chatNickDoubleClicked(QModelIndex))); |
238 |
250 |
239 connect(chatNicks, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(nicksContextMenuRequested(QPoint))); |
251 connect(chatNicks, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(nicksContextMenuRequested(QPoint))); |
240 |
252 |
241 mainLayout.addWidget(chatNicks, 0, 1, 3, 1); |
253 mainLayout.addSpacing(0); |
|
254 mainLayout.addWidget(chatNicks, 24); |
242 |
255 |
243 // the userData is used to flag things that are even available when user |
256 // the userData is used to flag things that are even available when user |
244 // is offline |
257 // is offline |
245 acInfo = new QAction(QAction::tr("Info"), chatNicks); |
258 acInfo = new QAction(QAction::tr("Info"), chatNicks); |
246 acInfo->setIcon(QIcon(":/res/info.png")); |
259 acInfo->setIcon(QIcon(":/res/info.png")); |