mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-01 02:53:56 -07:00
Added card hover + card info widget popup to MessageLogWidget
This commit is contained in:
parent
e1ad152f65
commit
cf95e5f328
6 changed files with 112 additions and 14 deletions
|
|
@ -1,19 +1,28 @@
|
|||
#ifndef MESSAGELOGWIDGET_H
|
||||
#define MESSAGELOGWIDGET_H
|
||||
|
||||
#include <QPlainTextEdit>
|
||||
#include <QTextEdit>
|
||||
#include <QAbstractSocket>
|
||||
#include "translation.h"
|
||||
#include "protocol_datastructures.h"
|
||||
|
||||
class Player;
|
||||
class CardZone;
|
||||
class QMouseEvent;
|
||||
class QEvent;
|
||||
class CardInfoWidget;
|
||||
|
||||
class MessageLogWidget : public QTextEdit {
|
||||
Q_OBJECT
|
||||
private:
|
||||
CardInfoWidget *infoWidget;
|
||||
QString sanitizeHtml(QString dirty) const;
|
||||
QString trZoneName(CardZone *zone, Player *player, bool hisOwn, GrammaticalCase gc) const;
|
||||
QString getCardNameUnderMouse(const QPoint &pos) const;
|
||||
signals:
|
||||
void cardNameHovered(QString cardName);
|
||||
void showCardInfoPopup(QPoint pos, QString cardName);
|
||||
void deleteCardInfoPopup();
|
||||
public slots:
|
||||
void logConnecting(QString hostname);
|
||||
void logConnected();
|
||||
|
|
@ -58,6 +67,12 @@ public slots:
|
|||
public:
|
||||
void connectToPlayer(Player *player);
|
||||
MessageLogWidget(QWidget *parent = 0);
|
||||
protected:
|
||||
void enterEvent(QEvent *event);
|
||||
void leaveEvent(QEvent *event);
|
||||
void mouseMoveEvent(QMouseEvent *event);
|
||||
void mousePressEvent(QMouseEvent *event);
|
||||
void mouseReleaseEvent(QMouseEvent *event);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue