overte/interface/src/ui/ChatMessageArea.h
Ryan Huffman 13cf0c80e6 Fix chat message formatting and word wrapping
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.
2014-04-12 00:20:43 -07:00

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