only show unread and grid view buttons when posts tab is selected

This commit is contained in:
csoler 2023-02-18 20:31:25 +01:00
parent 5069a1a10e
commit 456d742cd1
3 changed files with 20 additions and 1 deletions

View file

@ -418,6 +418,8 @@ GxsChannelPostsWidgetWithModel::GxsChannelPostsWidgetWithModel(const RsGxsGroupI
connect(ui->postsTree->selectionModel(),SIGNAL(selectionChanged(const QItemSelection&,const QItemSelection&)),this,SLOT(showPostDetails())); connect(ui->postsTree->selectionModel(),SIGNAL(selectionChanged(const QItemSelection&,const QItemSelection&)),this,SLOT(showPostDetails()));
connect(ui->postsTree,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(postContextMenu(const QPoint&))); connect(ui->postsTree,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(postContextMenu(const QPoint&)));
connect(ui->channel_TW,SIGNAL(currentChanged(int)),this,SLOT(currentTabChanged(int)));
connect(mChannelPostsModel,SIGNAL(channelPostsLoaded()),this,SLOT(postChannelPostLoad())); connect(mChannelPostsModel,SIGNAL(channelPostsLoaded()),this,SLOT(postChannelPostLoad()));
ui->postName_LB->hide(); ui->postName_LB->hide();
@ -503,6 +505,22 @@ GxsChannelPostsWidgetWithModel::GxsChannelPostsWidgetWithModel(const RsGxsGroupI
}, mEventHandlerId, RsEventType::GXS_CHANNELS ); }, mEventHandlerId, RsEventType::GXS_CHANNELS );
} }
void GxsChannelPostsWidgetWithModel::currentTabChanged(int t)
{
switch(t)
{
case CHANNEL_TABS_DETAILS:
case CHANNEL_TABS_FILES:
ui->showUnread_TB->setHidden(true);
ui->viewType_TB->setHidden(true);
break;
case CHANNEL_TABS_POSTS:
ui->showUnread_TB->setHidden(false);
ui->viewType_TB->setHidden(false);
break;
}
}
void GxsChannelPostsWidgetWithModel::updateZoomFactor(bool zoom_or_unzoom) void GxsChannelPostsWidgetWithModel::updateZoomFactor(bool zoom_or_unzoom)
{ {
mChannelPostsDelegate->zoom(zoom_or_unzoom); mChannelPostsDelegate->zoom(zoom_or_unzoom);

View file

@ -160,6 +160,7 @@ private slots:
void markMessageUnread(); void markMessageUnread();
public slots: public slots:
void currentTabChanged(int t);
void sortColumnFiles(int col,Qt::SortOrder so); void sortColumnFiles(int col,Qt::SortOrder so);
void sortColumnPostFiles(int col,Qt::SortOrder so); void sortColumnPostFiles(int col,Qt::SortOrder so);
void updateCommentsCount(int n); void updateCommentsCount(int n);

View file

@ -194,7 +194,7 @@
<item> <item>
<widget class="QTabWidget" name="channel_TW"> <widget class="QTabWidget" name="channel_TW">
<property name="currentIndex"> <property name="currentIndex">
<number>2</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="tab_3"> <widget class="QWidget" name="tab_3">
<attribute name="title"> <attribute name="title">