mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 01:10:44 +02:00
By switching from a QLabel to a QTextBrowser widget more formatting options and word wrapping that breaks words is possible. It comes with an issue I have been unable to resolve * Selecting text and going down with the cursor will cause it to scroll. It's possible to increase padding to remove this behavior, but it doesn't look great.
33 lines
686 B
C++
33 lines
686 B
C++
//
|
|
// ChatMessageArea.h
|
|
// interface/src/ui
|
|
//
|
|
// Created by Ryan Huffman on 4/11/14.
|
|
// Copyright 2014 High Fidelity, Inc.
|
|
//
|
|
// Distributed under the Apache License, Version 2.0.
|
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
|
//
|
|
|
|
#ifndef hifi_ChatMessageArea_h
|
|
#define hifi_ChatMessageArea_h
|
|
|
|
#include <QTextBrowser>
|
|
|
|
const int CHAT_MESSAGE_LINE_HEIGHT = 130;
|
|
|
|
class ChatMessageArea : public QTextBrowser {
|
|
Q_OBJECT
|
|
public:
|
|
ChatMessageArea();
|
|
virtual void setHtml(const QString& html);
|
|
|
|
public slots:
|
|
void updateLayout();
|
|
|
|
protected:
|
|
virtual void wheelEvent(QWheelEvent* event);
|
|
|
|
};
|
|
|
|
#endif // hifi_ChatMessageArea_h
|