From 56f3df6737dfc385ffaaf14463b96241c3db94cf Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 26 Sep 2020 17:47:09 +0200 Subject: [PATCH 1/4] removed "0 files" mention --- retroshare-gui/src/gui/common/RSTreeView.cpp | 3 +++ .../gxschannels/GxsChannelPostsWidgetWithModel.cpp | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/retroshare-gui/src/gui/common/RSTreeView.cpp b/retroshare-gui/src/gui/common/RSTreeView.cpp index d54987c3e..72b191fe2 100644 --- a/retroshare-gui/src/gui/common/RSTreeView.cpp +++ b/retroshare-gui/src/gui/common/RSTreeView.cpp @@ -30,7 +30,10 @@ RSTreeView::RSTreeView(QWidget *parent) : QTreeView(parent) void RSTreeView::wheelEvent(QWheelEvent *e) { if(e->modifiers() == Qt::ControlModifier) + { emit zoomRequested(e->delta() > 0); + return; + } else QTreeView::wheelEvent(e); } diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp index 91ab7ab0a..9e04c5af0 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp @@ -130,6 +130,7 @@ void ChannelPostDelegate::paint(QPainter * painter, const QStyleOptionViewItem & uint32_t flags = (mUseGrid)?(ChannelPostThumbnailView::FLAG_SHOW_TEXT | ChannelPostThumbnailView::FLAG_SCALE_FONT):0; ChannelPostThumbnailView w(post,flags); + w.setBackgroundRole(QPalette::AlternateBase); w.setAspectRatio(mAspectRatio); w.updateGeometry(); 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)); y += font_height; - 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; + 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") + ")" ); + y += font_height; + } painter->restore(); } @@ -285,7 +289,7 @@ void ChannelPostFilesDelegate::paint(QPainter * painter, const QStyleOptionViewI w.setFixedHeight(option.rect.height()); QPixmap pixmap(w.size()); - pixmap.fill(QRgb(0x00ffffff)); // choose a fully transparent background + pixmap.fill(QRgb(0x00ffffff)); // choose a fully transparent background w.render(&pixmap,QPoint(),QRegion(),QWidget::DrawChildren );// draw the widgets, not the background painter->drawPixmap(option.rect.topLeft(),pixmap); @@ -335,6 +339,7 @@ GxsChannelPostsWidgetWithModel::GxsChannelPostsWidgetWithModel(const RsGxsGroupI ui->showUnread_TB->setToolTip(tr("Show unread posts only")); connect(ui->showUnread_TB,SIGNAL(toggled(bool)),this,SLOT(switchOnlyUnread(bool))); + ui->postsTree->setAlternatingRowColors(true); ui->postsTree->setModel(mChannelPostsModel = new RsGxsChannelPostsModel()); ui->postsTree->setItemDelegate(mChannelPostsDelegate = new ChannelPostDelegate()); ui->postsTree->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); // prevents bug on w10, since row size depends on widget width From e389c01571ba0280f6e045f7d19d95436b9b579f Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 26 Sep 2020 18:50:51 +0200 Subject: [PATCH 2/4] fixed alternating row colors, and removed explicit background color --- .../GxsChannelPostsWidgetWithModel.cpp | 228 ++---------------- .../GxsChannelPostsWidgetWithModel.h | 3 - 2 files changed, 22 insertions(+), 209 deletions(-) diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp index 9e04c5af0..5d7aa8762 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp @@ -121,7 +121,11 @@ void ChannelPostDelegate::paint(QPainter * painter, const QStyleOptionViewItem & RsGxsChannelPost post = index.data(Qt::UserRole).value() ; - painter->fillRect( option.rect, option.backgroundBrush); + if(index.row() & 0x01) + painter->fillRect( option.rect, option.palette.alternateBase().color()); + else + painter->fillRect( option.rect, option.palette.base().color()); + painter->restore(); if(mUseGrid || index.column()==0) @@ -140,7 +144,14 @@ void ChannelPostDelegate::paint(QPainter * painter, const QStyleOptionViewItem & if((option.state & QStyle::State_Selected) && post.mMeta.mPublishTs > 0) // check if post is selected and is not empty (end of last row) pixmap.fill(SelectedColor); // I dont know how to grab the backgroud color for selected objects automatically. else - pixmap.fill(QRgb(0x00ffffff)); // choose a fully transparent background + { + // we need to do the alternate color manually + + if(index.row() & 0x01) + pixmap.fill(option.palette.alternateBase().color()); + else + pixmap.fill(option.palette.base().color()); + } w.render(&pixmap,QPoint(),QRegion(),QWidget::DrawChildren );// draw the widgets, not the background @@ -289,8 +300,14 @@ void ChannelPostFilesDelegate::paint(QPainter * painter, const QStyleOptionViewI w.setFixedHeight(option.rect.height()); QPixmap pixmap(w.size()); - pixmap.fill(QRgb(0x00ffffff)); // choose a fully transparent background - w.render(&pixmap,QPoint(),QRegion(),QWidget::DrawChildren );// draw the widgets, not the background + + // apparently we need to do the alternate colors manually + if(index.row() & 0x01) + pixmap.fill(option.palette.alternateBase().color()); + else + pixmap.fill(option.palette.base().color()); + + w.render(&pixmap,QPoint(),QRegion(),QWidget::DrawChildren );// draw the widgets, not the background painter->drawPixmap(option.rect.topLeft(),pixmap); } @@ -356,6 +373,7 @@ GxsChannelPostsWidgetWithModel::GxsChannelPostsWidgetWithModel(const RsGxsGroupI ui->channelPostFiles_TV->setPlaceholderText(tr("No files in this post, or no post selected")); ui->channelPostFiles_TV->setSortingEnabled(true); ui->channelPostFiles_TV->sortByColumn(0, Qt::AscendingOrder); + ui->channelPostFiles_TV->setAlternatingRowColors(true); ui->channelFiles_TV->setModel(mChannelFilesModel = new RsGxsChannelPostFilesModel()); ui->channelFiles_TV->setItemDelegate(mFilesDelegate = new ChannelPostFilesDelegate()); @@ -899,15 +917,7 @@ void GxsChannelPostsWidgetWithModel::processSettings(bool load) Settings->beginGroup(QString("ChannelPostsWidget")); if (load) { -#ifdef TO_REMOVE - // load settings - /* Filter */ - //ui->filterLineEdit->setCurrentFilter(Settings->value("filter", FILTER_TITLE).toInt()); - - /* View mode */ - //setViewMode(Settings->value("viewMode", VIEW_MODE_FEEDS).toInt()); -#endif // state of files tree channelpostfilesheader->restoreState(Settings->value("PostFilesTree").toByteArray()); channelfilesheader->restoreState(Settings->value("FilesTree").toByteArray()); @@ -915,15 +925,6 @@ void GxsChannelPostsWidgetWithModel::processSettings(bool load) // state of splitter ui->splitter->restoreState(Settings->value("SplitterChannelPosts").toByteArray()); } else { -#ifdef TO_REMOVE - // save settings - - /* Filter */ - //Settings->setValue("filter", ui->filterLineEdit->currentFilter()); - - /* View mode */ - //Settings->setValue("viewMode", viewMode()); -#endif // state of files tree Settings->setValue("PostFilesTree", channelpostfilesheader->saveState()); Settings->setValue("FilesTree", channelfilesheader->saveState()); @@ -1111,47 +1112,6 @@ void GxsChannelPostsWidgetWithModel::insertChannelDetails(const RsGxsChannelGrou showPostDetails(); } -#ifdef TODO -int GxsChannelPostsWidgetWithModel::viewMode() -{ - if (ui->feedToolButton->isChecked()) { - return VIEW_MODE_FEEDS; - } else if (ui->fileToolButton->isChecked()) { - return VIEW_MODE_FILES; - } - - /* Default */ - return VIEW_MODE_FEEDS; -} -#endif - -void GxsChannelPostsWidgetWithModel::setViewMode(int viewMode) -{ -#ifdef TODO - switch (viewMode) { - case VIEW_MODE_FEEDS: - ui->feedWidget->show(); - ui->fileWidget->hide(); - - ui->feedToolButton->setChecked(true); - ui->fileToolButton->setChecked(false); - - break; - case VIEW_MODE_FILES: - ui->feedWidget->hide(); - ui->fileWidget->show(); - - ui->feedToolButton->setChecked(false); - ui->fileToolButton->setChecked(true); - - break; - default: - setViewMode(VIEW_MODE_FEEDS); - return; - } -#endif -} - void GxsChannelPostsWidgetWithModel::switchOnlyUnread(bool) { filterChanged(ui->filterLineEdit->text()); @@ -1165,150 +1125,6 @@ void GxsChannelPostsWidgetWithModel::filterChanged(QString s) mChannelFilesModel->setFilter(ql,count); } -#ifdef TODO -/*static*/ bool GxsChannelPostsWidgetWithModel::filterItem(FeedItem *feedItem, const QString &text, int filter) -{ - GxsChannelPostItem *item = dynamic_cast(feedItem); - if (!item) { - return true; - } - - bool bVisible = text.isEmpty(); - - if (!bVisible) - { - switch(filter) - { - case FILTER_TITLE: - bVisible = item->getTitleLabel().contains(text,Qt::CaseInsensitive); - break; - case FILTER_MSG: - bVisible = item->getMsgLabel().contains(text,Qt::CaseInsensitive); - break; - case FILTER_FILE_NAME: - { - std::list fileItems = item->getFileItems(); - std::list::iterator lit; - for(lit = fileItems.begin(); lit != fileItems.end(); ++lit) - { - SubFileItem *fi = *lit; - QString fileName = QString::fromUtf8(fi->FileName().c_str()); - bVisible = (bVisible || fileName.contains(text,Qt::CaseInsensitive)); - } - break; - } - default: - bVisible = true; - break; - } - } - - return bVisible; -} - -void GxsChannelPostsWidget::createPostItemFromMetaData(const RsGxsMsgMetaData& meta,bool related) -{ - GxsChannelPostItem *item = NULL; - RsGxsChannelPost post; - - if(!meta.mOrigMsgId.isNull()) - { - FeedItem *feedItem = ui->feedWidget->findFeedItem(GxsChannelPostItem::computeIdentifier(meta.mOrigMsgId)) ; - item = dynamic_cast(feedItem); - - if(item) - { - post = feedItem->post(); - ui->feedWidget->removeFeedItem(item) ; - - post.mOlderVersions.insert(post.mMeta.mMsgId); - - GxsChannelPostItem *item = new GxsChannelPostItem(this, 0, post, true, false,post.mOlderVersions); - ui->feedWidget->addFeedItem(item, ROLE_PUBLISH, QDateTime::fromTime_t(post.mMeta.mPublishTs)); - - return ; - } - } - - if (related) - { - FeedItem *feedItem = ui->feedWidget->findFeedItem(GxsChannelPostItem::computeIdentifier(meta.mMsgId)) ; - item = dynamic_cast(feedItem); - } - if (item) - { - item->setPost(post); - ui->feedWidget->setSort(item, ROLE_PUBLISH, QDateTime::fromTime_t(meta.mPublishTs)); - } - else - { - GxsChannelPostItem *item = new GxsChannelPostItem(this, 0, meta.mGroupId,meta.mMsgId, true, true); - ui->feedWidget->addFeedItem(item, ROLE_PUBLISH, QDateTime::fromTime_t(post.mMeta.mPublishTs)); - } -#ifdef TODO - ui->fileWidget->addFiles(post, related); -#endif -} - -void GxsChannelPostsWidget::createPostItem(const RsGxsChannelPost& post, bool related) -{ - GxsChannelPostItem *item = NULL; - - const RsMsgMetaData& meta(post.mMeta); - - if(!meta.mOrigMsgId.isNull()) - { - FeedItem *feedItem = ui->feedWidget->findFeedItem(GxsChannelPostItem::computeIdentifier(meta.mOrigMsgId)) ; - item = dynamic_cast(feedItem); - - if(item) - { - std::set older_versions(item->olderVersions()); // we make a copy because the item will be deleted - ui->feedWidget->removeFeedItem(item) ; - - older_versions.insert(meta.mMsgId); - - GxsChannelPostItem *item = new GxsChannelPostItem(this, 0, mGroup.mMeta,meta.mMsgId, true, false,older_versions); - ui->feedWidget->addFeedItem(item, ROLE_PUBLISH, QDateTime::fromTime_t(meta.mPublishTs)); - - return ; - } - } - - if (related) - { - FeedItem *feedItem = ui->feedWidget->findFeedItem(GxsChannelPostItem::computeIdentifier(meta.mMsgId)) ; - item = dynamic_cast(feedItem); - } - if (item) - { - item->setPost(post); - ui->feedWidget->setSort(item, ROLE_PUBLISH, QDateTime::fromTime_t(meta.mPublishTs)); - } - else - { - GxsChannelPostItem *item = new GxsChannelPostItem(this, 0, mGroup.mMeta,meta.mMsgId, true, true); - ui->feedWidget->addFeedItem(item, ROLE_PUBLISH, QDateTime::fromTime_t(meta.mPublishTs)); - } - - ui->fileWidget->addFiles(post, related); -} - -void GxsChannelPostsWidget::fillThreadCreatePost(const QVariant &post, bool related, int current, int count) -{ - /* show fill progress */ - if (count) { - ui->progressBar->setValue(current * ui->progressBar->maximum() / count); - } - - if (!post.canConvert()) { - return; - } - - createPostItem(post.value(), related); -} -#endif - void GxsChannelPostsWidgetWithModel::blank() { ui->postButton->setEnabled(false); diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.h b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.h index daf2aedfb..36e3d7f5e 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.h +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.h @@ -147,7 +147,6 @@ private slots: void toggleAutoDownload(); void subscribeGroup(bool subscribe); void filterChanged(QString); - void setViewMode(int viewMode); void settingsChanged(); void handlePostsTreeSizeChange(QSize s, bool force=false); void postChannelPostLoad(); @@ -172,8 +171,6 @@ private: void setAutoDownload(bool autoDl); static bool filterItem(FeedItem *feedItem, const QString &text, int filter); - int viewMode(); - void insertChannelDetails(const RsGxsChannelGroup &group); void handleEvent_main_thread(std::shared_ptr event); From 1dddff9e5b93d105f4dce0940cfc8f9c933554fb Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 27 Sep 2020 20:08:36 +0200 Subject: [PATCH 3/4] added back links to posts in channel feeditems --- .../src/gui/feeds/GxsChannelPostItem.cpp | 44 +++++++-------- .../src/gui/feeds/GxsChannelPostItem.h | 2 +- .../src/gui/feeds/GxsChannelPostItem.ui | 56 ++++++------------- 3 files changed, 41 insertions(+), 61 deletions(-) diff --git a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp index aa35fc0cc..560cbfa10 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp @@ -156,7 +156,7 @@ void GxsChannelPostItem::setup() // memory. ui->logoLabel->setPixmap(FilesDefs::getPixmapFromQtResourcePath(":/images/thumb-default-video.png")); - ui->warn_image_label->setPixmap(FilesDefs::getPixmapFromQtResourcePath(":/images/status_unknown.png")); + //ui->warn_image_label->setPixmap(FilesDefs::getPixmapFromQtResourcePath(":/images/status_unknown.png")); ui->readButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/message-state-unread.png")); ui->voteUpButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/vote_up.png")); ui->voteDownButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/vote_down.png")); @@ -211,12 +211,12 @@ void GxsChannelPostItem::setup() ui->downloadButton->hide(); ui->playButton->hide(); - ui->warn_image_label->hide(); - ui->warning_label->hide(); + //ui->warn_image_label->hide(); + //ui->warning_label->hide(); ui->titleLabel->setMinimumWidth(100); //ui->subjectLabel->setMinimumWidth(100); - ui->warning_label->setMinimumWidth(100); + //ui->warning_label->setMinimumWidth(100); ui->mainFrame->setProperty("new", false); ui->mainFrame->style()->unpolish(ui->mainFrame); @@ -466,7 +466,7 @@ void GxsChannelPostItem::fill() ui->titleLabel->setText(title); RetroShareLink msgLink = RetroShareLink::createGxsMessageLink(RetroShareLink::TYPE_CHANNEL, mPost.mMeta.mGroupId, mPost.mMeta.mMsgId, messageName()); - //ui->subjectLabel->setText(msgLink.toHtml()); + ui->subjectLabel->setText(msgLink.toHtml()); if (IS_GROUP_SUBSCRIBED(mGroupMeta.mSubscribeFlags) || IS_GROUP_ADMIN(mGroupMeta.mSubscribeFlags)) { @@ -489,12 +489,12 @@ void GxsChannelPostItem::fill() /* subject */ ui->titleLabel->setText(QString::fromUtf8(mPost.mMeta.mMsgName.c_str())); - //uint32_t autorized_lines = (int)floor((ui->logoLabel->height() - ui->titleLabel->height() - ui->buttonHLayout->sizeHint().height())/QFontMetricsF(ui->subjectLabel->font()).height()); + uint32_t autorized_lines = (int)floor((ui->logoLabel->height() - ui->titleLabel->height() - ui->buttonHLayout->sizeHint().height())/QFontMetricsF(ui->subjectLabel->font()).height()); // fill first 4 lines of message. (csoler) Disabled the replacement of smileys and links, because the cost is too crazy //ui->subjectLabel->setText(RsHtml().formatText(NULL, RsStringUtil::CopyLines(QString::fromUtf8(mPost.mMsg.c_str()), autorized_lines), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS)); - //ui->subjectLabel->setText(RsStringUtil::CopyLines(QString::fromUtf8(mPost.mMsg.c_str()), 2)) ; + ui->subjectLabel->setText(RsStringUtil::CopyLines(QString::fromUtf8(mPost.mMsg.c_str()), 2)) ; //QString score = QString::number(post.mTopScore); // scoreLabel->setText(score); @@ -654,21 +654,21 @@ void GxsChannelPostItem::setReadStatus(bool isNew, bool isUnread) ui->mainFrame->style()->polish( ui->mainFrame); } -void GxsChannelPostItem::setFileCleanUpWarning(uint32_t time_left) -{ - int hours = (int)time_left/3600; - int minutes = (time_left - hours*3600)%60; - - ui->warning_label->setText(tr("Warning! You have less than %1 hours and %2 minute before this file is deleted Consider saving it.").arg( - QString::number(hours)).arg(QString::number(minutes))); - - QFont warnFont = ui->warning_label->font(); - warnFont.setBold(true); - ui->warning_label->setFont(warnFont); - - ui->warn_image_label->setVisible(true); - ui->warning_label->setVisible(true); -} +// void GxsChannelPostItem::setFileCleanUpWarning(uint32_t time_left) +// { +// int hours = (int)time_left/3600; +// int minutes = (time_left - hours*3600)%60; +// +// ui->warning_label->setText(tr("Warning! You have less than %1 hours and %2 minute before this file is deleted Consider saving it.").arg( +// QString::number(hours)).arg(QString::number(minutes))); +// +// QFont warnFont = ui->warning_label->font(); +// warnFont.setBold(true); +// ui->warning_label->setFont(warnFont); +// +// ui->warn_image_label->setVisible(true); +// ui->warning_label->setVisible(true); +// } void GxsChannelPostItem::updateItem() { diff --git a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h index 315972bb1..8370b885e 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h +++ b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h @@ -56,7 +56,7 @@ public: bool setGroup(const RsGxsChannelGroup& group, bool doFill = true); bool setPost(const RsGxsChannelPost& post, bool doFill = true); - void setFileCleanUpWarning(uint32_t time_left); + //void setFileCleanUpWarning(uint32_t time_left); QString getTitleLabel(); QString getMsgLabel(); diff --git a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.ui b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.ui index 3c524b1d6..2188df912 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.ui +++ b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.ui @@ -6,8 +6,8 @@ 0 0 - 922 - 187 + 1092 + 231 @@ -124,6 +124,16 @@ + + + + TextLabel + + + true + + + @@ -137,33 +147,6 @@ - - - - - - - - - - 24 - 16777215 - - - - - - - - - - - TextLabel - - - - - @@ -486,21 +469,18 @@ + + StyledElidedLabel + QLabel +
gui/common/StyledElidedLabel.h
+
ElidedLabel QLabel
gui/common/ElidedLabel.h
1
- - StyledElidedLabel - QLabel -
gui/common/StyledElidedLabel.h
-
- - - - + From 07e93471226d0fadda13f56dc3238d933bc82072 Mon Sep 17 00:00:00 2001 From: csoler Date: Fri, 2 Oct 2020 17:56:59 +0200 Subject: [PATCH 4/4] removed alternate row colors. Added a tooltip about zooming --- .../GxsChannelPostsWidgetWithModel.cpp | 22 +++++++++---------- .../GxsChannelPostsWidgetWithModel.ui | 21 ++++++++++-------- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp index 5d7aa8762..c663c3125 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp @@ -121,9 +121,9 @@ void ChannelPostDelegate::paint(QPainter * painter, const QStyleOptionViewItem & RsGxsChannelPost post = index.data(Qt::UserRole).value() ; - if(index.row() & 0x01) - painter->fillRect( option.rect, option.palette.alternateBase().color()); - else + // if(index.row() & 0x01) + // painter->fillRect( option.rect, option.palette.alternateBase().color()); + // else painter->fillRect( option.rect, option.palette.base().color()); painter->restore(); @@ -147,9 +147,9 @@ void ChannelPostDelegate::paint(QPainter * painter, const QStyleOptionViewItem & { // we need to do the alternate color manually - if(index.row() & 0x01) - pixmap.fill(option.palette.alternateBase().color()); - else + //if(index.row() & 0x01) + // pixmap.fill(option.palette.alternateBase().color()); + //else pixmap.fill(option.palette.base().color()); } @@ -302,9 +302,9 @@ void ChannelPostFilesDelegate::paint(QPainter * painter, const QStyleOptionViewI QPixmap pixmap(w.size()); // apparently we need to do the alternate colors manually - if(index.row() & 0x01) - pixmap.fill(option.palette.alternateBase().color()); - else + //if(index.row() & 0x01) + // pixmap.fill(option.palette.alternateBase().color()); + //else pixmap.fill(option.palette.base().color()); w.render(&pixmap,QPoint(),QRegion(),QWidget::DrawChildren );// draw the widgets, not the background @@ -356,7 +356,7 @@ GxsChannelPostsWidgetWithModel::GxsChannelPostsWidgetWithModel(const RsGxsGroupI ui->showUnread_TB->setToolTip(tr("Show unread posts only")); connect(ui->showUnread_TB,SIGNAL(toggled(bool)),this,SLOT(switchOnlyUnread(bool))); - ui->postsTree->setAlternatingRowColors(true); + ui->postsTree->setAlternatingRowColors(false); ui->postsTree->setModel(mChannelPostsModel = new RsGxsChannelPostsModel()); ui->postsTree->setItemDelegate(mChannelPostsDelegate = new ChannelPostDelegate()); ui->postsTree->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); // prevents bug on w10, since row size depends on widget width @@ -373,7 +373,7 @@ GxsChannelPostsWidgetWithModel::GxsChannelPostsWidgetWithModel(const RsGxsGroupI ui->channelPostFiles_TV->setPlaceholderText(tr("No files in this post, or no post selected")); ui->channelPostFiles_TV->setSortingEnabled(true); ui->channelPostFiles_TV->sortByColumn(0, Qt::AscendingOrder); - ui->channelPostFiles_TV->setAlternatingRowColors(true); + ui->channelPostFiles_TV->setAlternatingRowColors(false); ui->channelFiles_TV->setModel(mChannelFilesModel = new RsGxsChannelPostFilesModel()); ui->channelFiles_TV->setItemDelegate(mFilesDelegate = new ChannelPostFilesDelegate()); diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.ui b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.ui index 38b7c4902..46683b31c 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.ui +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.ui @@ -393,6 +393,9 @@ p, li { white-space: pre-wrap; } Qt::CustomContextMenu + + <html><head/><body><p>Click to view post. </p><p>Use Ctrl+mouse wheel </p><p>to zoom/unzoom.</p></body></html> + QAbstractScrollArea::AdjustToContents @@ -428,7 +431,7 @@ p, li { white-space: pre-wrap; } - 0 + 1 @@ -593,16 +596,16 @@ p, li { white-space: pre-wrap; } QToolButton
gui/common/SubscribeToolButton.h
- - StyledElidedLabel - QLabel -
gui/common/StyledElidedLabel.h
-
RSTreeView QTreeView
gui/common/RSTreeView.h
+ + LineEditClear + QLineEdit +
gui/common/LineEditClear.h
+
GxsCommentDialog QWidget @@ -610,9 +613,9 @@ p, li { white-space: pre-wrap; } 1 - LineEditClear - QLineEdit -
gui/common/LineEditClear.h
+ StyledElidedLabel + QLabel +
gui/common/StyledElidedLabel.h