mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-04 12:33:55 -07:00
chatview improvement
This commit is contained in:
parent
add47315d5
commit
fccc91818d
4 changed files with 76 additions and 76 deletions
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include <QTextBrowser>
|
||||
#include <QTextFragment>
|
||||
#include <QTextCursor>
|
||||
#include <QColor>
|
||||
|
||||
class QTextTable;
|
||||
|
|
@ -11,16 +12,18 @@ class QMouseEvent;
|
|||
class ChatView : public QTextBrowser {
|
||||
Q_OBJECT;
|
||||
private:
|
||||
QTextTable *table;
|
||||
bool evenNumber;
|
||||
QString ownName;
|
||||
bool showTimestamps;
|
||||
QTextFragment getFragmentUnderMouse(const QPoint &pos) const;
|
||||
QString getCardNameUnderMouse(QTextFragment frag) const;
|
||||
QString getCardNameUnderMouse(const QPoint &pos) const;
|
||||
QTextCursor prepareBlock();
|
||||
private slots:
|
||||
void openLink(const QUrl &link);
|
||||
public:
|
||||
ChatView(const QString &_ownName, bool _showTimestamps, QWidget *parent = 0);
|
||||
void appendHtml(const QString &html);
|
||||
void appendMessage(QString sender, QString message, QColor playerColor = QColor(), bool playerBold = false);
|
||||
protected:
|
||||
void enterEvent(QEvent *event);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue