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>() ; RsGxsChannelPost post = index.data(Qt::UserRole).value<RsGxsChannelPost>() ;
if(index.row() & 0x01) // if(index.row() & 0x01)
painter->fillRect( option.rect, option.palette.alternateBase().color()); // painter->fillRect( option.rect, option.palette.alternateBase().color());
else // else
painter->fillRect( option.rect, option.palette.base().color()); painter->fillRect( option.rect, option.palette.base().color());
painter->restore(); painter->restore();
@ -147,9 +147,9 @@ void ChannelPostDelegate::paint(QPainter * painter, const QStyleOptionViewItem &
{ {
// we need to do the alternate color manually // we need to do the alternate color manually
if(index.row() & 0x01) //if(index.row() & 0x01)
pixmap.fill(option.palette.alternateBase().color()); // pixmap.fill(option.palette.alternateBase().color());
else //else
pixmap.fill(option.palette.base().color()); pixmap.fill(option.palette.base().color());
} }
@ -302,9 +302,9 @@ void ChannelPostFilesDelegate::paint(QPainter * painter, const QStyleOptionViewI
QPixmap pixmap(w.size()); QPixmap pixmap(w.size());
// apparently we need to do the alternate colors manually // apparently we need to do the alternate colors manually
if(index.row() & 0x01) //if(index.row() & 0x01)
pixmap.fill(option.palette.alternateBase().color()); // pixmap.fill(option.palette.alternateBase().color());
else //else
pixmap.fill(option.palette.base().color()); pixmap.fill(option.palette.base().color());
w.render(&pixmap,QPoint(),QRegion(),QWidget::DrawChildren );// draw the widgets, not the background 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")); 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->setAlternatingRowColors(false);
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
@ -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->setPlaceholderText(tr("No files in this post, or no post selected"));
ui->channelPostFiles_TV->setSortingEnabled(true); ui->channelPostFiles_TV->setSortingEnabled(true);
ui->channelPostFiles_TV->sortByColumn(0, Qt::AscendingOrder); 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->setModel(mChannelFilesModel = new RsGxsChannelPostFilesModel());
ui->channelFiles_TV->setItemDelegate(mFilesDelegate = new ChannelPostFilesDelegate()); ui->channelFiles_TV->setItemDelegate(mFilesDelegate = new ChannelPostFilesDelegate());

View file

@ -393,6 +393,9 @@ p, li { white-space: pre-wrap; }
<property name="contextMenuPolicy"> <property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum> <enum>Qt::CustomContextMenu</enum>
</property> </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"> <property name="sizeAdjustPolicy">
<enum>QAbstractScrollArea::AdjustToContents</enum> <enum>QAbstractScrollArea::AdjustToContents</enum>
</property> </property>
@ -428,7 +431,7 @@ p, li { white-space: pre-wrap; }
</font> </font>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>1</number>
</property> </property>
<widget class="QWidget" name="tab"> <widget class="QWidget" name="tab">
<attribute name="title"> <attribute name="title">
@ -593,16 +596,16 @@ p, li { white-space: pre-wrap; }
<extends>QToolButton</extends> <extends>QToolButton</extends>
<header>gui/common/SubscribeToolButton.h</header> <header>gui/common/SubscribeToolButton.h</header>
</customwidget> </customwidget>
<customwidget>
<class>StyledElidedLabel</class>
<extends>QLabel</extends>
<header>gui/common/StyledElidedLabel.h</header>
</customwidget>
<customwidget> <customwidget>
<class>RSTreeView</class> <class>RSTreeView</class>
<extends>QTreeView</extends> <extends>QTreeView</extends>
<header>gui/common/RSTreeView.h</header> <header>gui/common/RSTreeView.h</header>
</customwidget> </customwidget>
<customwidget>
<class>LineEditClear</class>
<extends>QLineEdit</extends>
<header>gui/common/LineEditClear.h</header>
</customwidget>
<customwidget> <customwidget>
<class>GxsCommentDialog</class> <class>GxsCommentDialog</class>
<extends>QWidget</extends> <extends>QWidget</extends>
@ -610,9 +613,9 @@ p, li { white-space: pre-wrap; }
<container>1</container> <container>1</container>
</customwidget> </customwidget>
<customwidget> <customwidget>
<class>LineEditClear</class> <class>StyledElidedLabel</class>
<extends>QLineEdit</extends> <extends>QLabel</extends>
<header>gui/common/LineEditClear.h</header> <header>gui/common/StyledElidedLabel.h</header>
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<resources> <resources>