removed alternate row colors. Added a tooltip about zooming

This commit is contained in:
csoler 2020-10-02 17:56:59 +02:00
parent 1dddff9e5b
commit 07e9347122
2 changed files with 23 additions and 20 deletions

View File

@ -121,9 +121,9 @@ void ChannelPostDelegate::paint(QPainter * painter, const QStyleOptionViewItem &
RsGxsChannelPost post = index.data(Qt::UserRole).value<RsGxsChannelPost>() ;
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());

View File

@ -393,6 +393,9 @@ p, li { white-space: pre-wrap; }
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Click to view post. &lt;/p&gt;&lt;p&gt;Use Ctrl+mouse wheel &lt;/p&gt;&lt;p&gt;to zoom/unzoom.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="sizeAdjustPolicy">
<enum>QAbstractScrollArea::AdjustToContents</enum>
</property>
@ -428,7 +431,7 @@ p, li { white-space: pre-wrap; }
</font>
</property>
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
@ -593,16 +596,16 @@ p, li { white-space: pre-wrap; }
<extends>QToolButton</extends>
<header>gui/common/SubscribeToolButton.h</header>
</customwidget>
<customwidget>
<class>StyledElidedLabel</class>
<extends>QLabel</extends>
<header>gui/common/StyledElidedLabel.h</header>
</customwidget>
<customwidget>
<class>RSTreeView</class>
<extends>QTreeView</extends>
<header>gui/common/RSTreeView.h</header>
</customwidget>
<customwidget>
<class>LineEditClear</class>
<extends>QLineEdit</extends>
<header>gui/common/LineEditClear.h</header>
</customwidget>
<customwidget>
<class>GxsCommentDialog</class>
<extends>QWidget</extends>
@ -610,9 +613,9 @@ p, li { white-space: pre-wrap; }
<container>1</container>
</customwidget>
<customwidget>
<class>LineEditClear</class>
<extends>QLineEdit</extends>
<header>gui/common/LineEditClear.h</header>
<class>StyledElidedLabel</class>
<extends>QLabel</extends>
<header>gui/common/StyledElidedLabel.h</header>
</customwidget>
</customwidgets>
<resources>