atrooney-online-2/include/aotextarea.h
oldmud0 faac191f0b Mega-merge of CR fork
CR likely stands for "CentsRaidensnake." Like the Case Cafe mega-merge
before it, this was not a clean merge, and it had to be split up into
two parts: the actual changes, and the attempt it made to reformat the
entire code via clang-format.

This branch had a complicated set of changes that would be difficult to
describe in this commit message. It would be better described in a
proper changelog.
2020-04-17 21:48:34 -05:00

26 lines
606 B
C++

#ifndef AOTEXTAREA_H
#define AOTEXTAREA_H
#include <QTextBrowser>
#include <QScrollBar>
#include <QTextCursor>
#include <QRegExp>
#include <QDebug>
class AOTextArea : public QTextBrowser
{
public:
AOTextArea(QWidget *p_parent = nullptr);
void append_chatmessage(QString p_name, QString p_message, QString p_colour,
bool song);
void append_error(QString p_message);
private:
const QRegExp omnis_dank_url_regex = QRegExp("\\b(https?://\\S+\\.\\S+)\\b");
void auto_scroll(QTextCursor old_cursor, int scrollbar_value, bool is_scrolled_down);
};
#endif // AOTEXTAREA_H