|
|
@ -37,6 +37,32 @@ |
|
|
|
constexpr int MSG_RIGHT_MARGIN = 7; |
|
|
|
constexpr int MSG_RIGHT_MARGIN = 7; |
|
|
|
constexpr int MSG_PADDING = 20; |
|
|
|
constexpr int MSG_PADDING = 20; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TextLabel::TextLabel(const QString &text, QWidget *parent) |
|
|
|
|
|
|
|
: QTextBrowser(parent) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
setText(text); |
|
|
|
|
|
|
|
setOpenExternalLinks(true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Make it look and feel like an ordinary label.
|
|
|
|
|
|
|
|
setReadOnly(true); |
|
|
|
|
|
|
|
setFrameStyle(QFrame::NoFrame); |
|
|
|
|
|
|
|
QPalette pal = palette(); |
|
|
|
|
|
|
|
pal.setColor(QPalette::Base, Qt::transparent); |
|
|
|
|
|
|
|
setPalette(pal); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Wrap anywhere but prefer words, adjust minimum height on the fly.
|
|
|
|
|
|
|
|
setLineWrapMode(QTextEdit::WidgetWidth); |
|
|
|
|
|
|
|
setWordWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere); |
|
|
|
|
|
|
|
connect(document()->documentLayout(), |
|
|
|
|
|
|
|
&QAbstractTextDocumentLayout::documentSizeChanged, |
|
|
|
|
|
|
|
this, |
|
|
|
|
|
|
|
&TextLabel::adjustHeight); |
|
|
|
|
|
|
|
document()->setDocumentMargin(0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); |
|
|
|
|
|
|
|
setFixedHeight(0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
StatusIndicator::StatusIndicator(QWidget *parent) |
|
|
|
StatusIndicator::StatusIndicator(QWidget *parent) |
|
|
|
: QWidget(parent) |
|
|
|
: QWidget(parent) |
|
|
|
{ |
|
|
|
{ |
|
|
|