mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-23 07:03:54 -07:00
improved banning; added [url] and [card] tags for chat
This commit is contained in:
parent
4b84168bda
commit
05ebb83ba4
36 changed files with 2501 additions and 2073 deletions
|
|
@ -1,18 +1,36 @@
|
|||
#ifndef CHATVIEW_H
|
||||
#define CHATVIEW_H
|
||||
|
||||
#include <QTextEdit>
|
||||
#include <QTextBrowser>
|
||||
#include <QTextFragment>
|
||||
|
||||
class QTextTable;
|
||||
class QMouseEvent;
|
||||
|
||||
class ChatView : public QTextEdit {
|
||||
class ChatView : public QTextBrowser {
|
||||
Q_OBJECT;
|
||||
private:
|
||||
QTextTable *table;
|
||||
QString ownName;
|
||||
bool showTimestamps;
|
||||
QTextFragment getFragmentUnderMouse(const QPoint &pos) const;
|
||||
QString getCardNameUnderMouse(QTextFragment frag) const;
|
||||
QString getCardNameUnderMouse(const QPoint &pos) const;
|
||||
private slots:
|
||||
void openLink(const QUrl &link);
|
||||
public:
|
||||
ChatView(const QString &_ownName, QWidget *parent = 0);
|
||||
void appendMessage(QString sender, const QString &message);
|
||||
ChatView(const QString &_ownName, bool _showTimestamps, QWidget *parent = 0);
|
||||
void appendMessage(QString sender, QString message);
|
||||
protected:
|
||||
void enterEvent(QEvent *event);
|
||||
void leaveEvent(QEvent *event);
|
||||
void mouseMoveEvent(QMouseEvent *event);
|
||||
void mousePressEvent(QMouseEvent *event);
|
||||
void mouseReleaseEvent(QMouseEvent *event);
|
||||
signals:
|
||||
void cardNameHovered(QString cardName);
|
||||
void showCardInfoPopup(QPoint pos, QString cardName);
|
||||
void deleteCardInfoPopup();
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue