mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-26 01:31:30 -05:00
removed "0 files" mention
This commit is contained in:
parent
e48986013f
commit
56f3df6737
@ -30,7 +30,10 @@ RSTreeView::RSTreeView(QWidget *parent) : QTreeView(parent)
|
|||||||
void RSTreeView::wheelEvent(QWheelEvent *e)
|
void RSTreeView::wheelEvent(QWheelEvent *e)
|
||||||
{
|
{
|
||||||
if(e->modifiers() == Qt::ControlModifier)
|
if(e->modifiers() == Qt::ControlModifier)
|
||||||
|
{
|
||||||
emit zoomRequested(e->delta() > 0);
|
emit zoomRequested(e->delta() > 0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
QTreeView::wheelEvent(e);
|
QTreeView::wheelEvent(e);
|
||||||
}
|
}
|
||||||
|
@ -130,6 +130,7 @@ void ChannelPostDelegate::paint(QPainter * painter, const QStyleOptionViewItem &
|
|||||||
|
|
||||||
uint32_t flags = (mUseGrid)?(ChannelPostThumbnailView::FLAG_SHOW_TEXT | ChannelPostThumbnailView::FLAG_SCALE_FONT):0;
|
uint32_t flags = (mUseGrid)?(ChannelPostThumbnailView::FLAG_SHOW_TEXT | ChannelPostThumbnailView::FLAG_SCALE_FONT):0;
|
||||||
ChannelPostThumbnailView w(post,flags);
|
ChannelPostThumbnailView w(post,flags);
|
||||||
|
w.setBackgroundRole(QPalette::AlternateBase);
|
||||||
w.setAspectRatio(mAspectRatio);
|
w.setAspectRatio(mAspectRatio);
|
||||||
w.updateGeometry();
|
w.updateGeometry();
|
||||||
w.adjustSize();
|
w.adjustSize();
|
||||||
@ -198,8 +199,11 @@ void ChannelPostDelegate::paint(QPainter * painter, const QStyleOptionViewItem &
|
|||||||
painter->drawText(QPoint(p.x()+0.5*font_height,y),QDateTime::fromSecsSinceEpoch(post.mMeta.mPublishTs).toString(Qt::DefaultLocaleShortDate));
|
painter->drawText(QPoint(p.x()+0.5*font_height,y),QDateTime::fromSecsSinceEpoch(post.mMeta.mPublishTs).toString(Qt::DefaultLocaleShortDate));
|
||||||
y += font_height;
|
y += font_height;
|
||||||
|
|
||||||
|
if(post.mCount > 0)
|
||||||
|
{
|
||||||
painter->drawText(QPoint(p.x()+0.5*font_height,y),QString::number(post.mCount)+ " " +((post.mCount>1)?tr("files"):tr("file")) + " (" + QString::number(post.mSize) + " " + tr("bytes") + ")" );
|
painter->drawText(QPoint(p.x()+0.5*font_height,y),QString::number(post.mCount)+ " " +((post.mCount>1)?tr("files"):tr("file")) + " (" + QString::number(post.mSize) + " " + tr("bytes") + ")" );
|
||||||
y += font_height;
|
y += font_height;
|
||||||
|
}
|
||||||
|
|
||||||
painter->restore();
|
painter->restore();
|
||||||
}
|
}
|
||||||
@ -335,6 +339,7 @@ GxsChannelPostsWidgetWithModel::GxsChannelPostsWidgetWithModel(const RsGxsGroupI
|
|||||||
ui->showUnread_TB->setToolTip(tr("Show unread posts only"));
|
ui->showUnread_TB->setToolTip(tr("Show unread posts only"));
|
||||||
connect(ui->showUnread_TB,SIGNAL(toggled(bool)),this,SLOT(switchOnlyUnread(bool)));
|
connect(ui->showUnread_TB,SIGNAL(toggled(bool)),this,SLOT(switchOnlyUnread(bool)));
|
||||||
|
|
||||||
|
ui->postsTree->setAlternatingRowColors(true);
|
||||||
ui->postsTree->setModel(mChannelPostsModel = new RsGxsChannelPostsModel());
|
ui->postsTree->setModel(mChannelPostsModel = new RsGxsChannelPostsModel());
|
||||||
ui->postsTree->setItemDelegate(mChannelPostsDelegate = new ChannelPostDelegate());
|
ui->postsTree->setItemDelegate(mChannelPostsDelegate = new ChannelPostDelegate());
|
||||||
ui->postsTree->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); // prevents bug on w10, since row size depends on widget width
|
ui->postsTree->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); // prevents bug on w10, since row size depends on widget width
|
||||||
|
Loading…
x
Reference in New Issue
Block a user