mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-07 22:22:45 -04:00
Added tabs to gxsforums.
Moved the thread message part from GxsForumsDialog to GxsForumThreadWidget. Added placeholder text to existing and new base classes to display for example "Loading". git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5905 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
ca3ef27595
commit
25de47c6f9
13 changed files with 2946 additions and 2463 deletions
|
@ -1,4 +1,5 @@
|
|||
#include <QDesktopServices>
|
||||
#include <QPainter>
|
||||
|
||||
#include "LinkTextBrowser.h"
|
||||
|
||||
|
@ -17,3 +18,27 @@ void LinkTextBrowser::linkClicked(const QUrl &url)
|
|||
// so we handle links by our own
|
||||
QDesktopServices::openUrl(url);
|
||||
}
|
||||
|
||||
void LinkTextBrowser::setPlaceholderText(const QString &text)
|
||||
{
|
||||
placeholderText = text;
|
||||
viewport()->repaint();
|
||||
}
|
||||
|
||||
void LinkTextBrowser::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
QTextBrowser::paintEvent(event);
|
||||
|
||||
if (placeholderText.isEmpty() == false && document()->isEmpty()) {
|
||||
QWidget *vieportWidget = viewport();
|
||||
QPainter painter(vieportWidget);
|
||||
|
||||
QPen pen = painter.pen();
|
||||
QColor color = pen.color();
|
||||
color.setAlpha(128);
|
||||
pen.setColor(color);
|
||||
painter.setPen(pen);
|
||||
|
||||
painter.drawText(QRect(QPoint(), vieportWidget->size()), Qt::AlignHCenter | Qt::AlignVCenter | Qt::TextWordWrap, placeholderText);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue