Add context menu to show hidden image on lobby.

A tooltip show hidden image too.
The RSImageBlockWidget is removed.
This commit is contained in:
Phenom 2016-09-24 16:12:44 +02:00
parent 854eebb2cb
commit fdfd2e9248
7 changed files with 134 additions and 54 deletions

View file

@ -4,6 +4,8 @@
#include <QTextBrowser>
#include "util/RsSyntaxHighlighter.h"
//#define RSTEXTBROWSER_CHECKIMAGE_DEBUG 1
class RSImageBlockWidget;
class RSTextBrowser : public QTextBrowser
@ -18,16 +20,20 @@ public:
void setPlaceholderText(const QString &text);
void setImageBlockWidget(RSImageBlockWidget *widget);
void resetImagesStatus(bool load);
QPixmap getBlockedImage();
bool checkImage(QPoint pos, QString &imageStr);
bool checkImage(QPoint pos) {QString imageStr; return checkImage(pos, imageStr); }
void activateLinkClick(bool active);
virtual QVariant loadResource(int type, const QUrl &name);
QColor textColorQuote() const { return highliter->textColorQuote();}
QColor textColorQuote() const { return highlighter->textColorQuote();}
bool getShowImages() const { return mShowImages; }
public slots:
void showImages();
void setTextColorQuote(QColor textColorQuote) { highliter->setTextColorQuote(textColorQuote);}
void setTextColorQuote(QColor textColorQuote) { highlighter->setTextColorQuote(textColorQuote);}
private slots:
void linkClicked(const QUrl &url);
@ -41,7 +47,13 @@ private:
bool mShowImages;
RSImageBlockWidget *mImageBlockWidget;
bool mLinkClickActive;
RsSyntaxHighlighter *highliter;
RsSyntaxHighlighter *highlighter;
#ifdef RSTEXTBROWSER_CHECKIMAGE_DEBUG
QRect mCursorRectStart;
QRect mCursorRectLeft;
QRect mCursorRectRight;
QRect mCursorRectEnd;
#endif
};
#endif // RSTEXTBROWSER_H