Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
acaeadfc
Commit
acaeadfc
authored
Jul 13, 2015
by
Zach
Browse files
Merge pull request #1241 from ZeldaZach/fix_719
parents
9edacd7b
29aecc4e
Changes
3
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/chatview.cpp
View file @
acaeadfc
...
...
@@ -73,10 +73,16 @@ void ChatView::appendHtml(const QString &html)
verticalScrollBar
()
->
setValue
(
verticalScrollBar
()
->
maximum
());
}
void
ChatView
::
appendHtmlServerMessage
(
const
QString
&
html
)
void
ChatView
::
appendHtmlServerMessage
(
const
QString
&
html
,
bool
optionalIsBold
,
QString
optionalFontColor
)
{
bool
atBottom
=
verticalScrollBar
()
->
value
()
>=
verticalScrollBar
()
->
maximum
();
prepareBlock
().
insertHtml
(
"<font color="
+
SERVER_MESSAGE_COLOR
+
">"
+
html
+
"</font>"
);
QString
htmlText
=
"<font color="
+
((
optionalFontColor
.
size
()
>
0
)
?
optionalFontColor
:
SERVER_MESSAGE_COLOR
)
+
">"
+
html
+
"</font>"
;
if
(
optionalIsBold
)
htmlText
=
"<b>"
+
htmlText
+
"</b>"
;
prepareBlock
().
insertHtml
(
htmlText
);
if
(
atBottom
)
verticalScrollBar
()
->
setValue
(
verticalScrollBar
()
->
maximum
());
}
...
...
cockatrice/src/chatview.h
View file @
acaeadfc
...
...
@@ -51,7 +51,7 @@ public:
ChatView
(
const
TabSupervisor
*
_tabSupervisor
,
TabGame
*
_game
,
bool
_showTimestamps
,
QWidget
*
parent
=
0
);
void
retranslateUi
();
void
appendHtml
(
const
QString
&
html
);
void
appendHtmlServerMessage
(
const
QString
&
html
);
void
appendHtmlServerMessage
(
const
QString
&
html
,
bool
optionalIsBold
=
false
,
QString
optionalFontColor
=
QString
()
);
void
appendMessage
(
QString
message
,
QString
sender
=
QString
(),
UserLevelFlags
userLevel
=
UserLevelFlags
(),
bool
playerBold
=
false
);
void
clearChat
();
protected:
...
...
cockatrice/src/messagelogwidget.cpp
View file @
acaeadfc
...
...
@@ -76,7 +76,7 @@ void MessageLogWidget::logGameClosed()
void
MessageLogWidget
::
logKicked
()
{
appendHtmlServerMessage
(
tr
(
"You have been kicked out of the game."
));
appendHtmlServerMessage
(
tr
(
"You have been kicked out of the game."
)
,
true
);
}
void
MessageLogWidget
::
logJoinSpectator
(
QString
name
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment