Merge pull request #1506 from defnax/subscribe-button-with-count

Count subscribers on the channels subscribe button like Youtube
This commit is contained in:
csoler 2019-03-28 20:04:52 +01:00 committed by GitHub
commit da57f80095
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 26 deletions

View File

@ -244,8 +244,6 @@ void GxsChannelPostsWidget::insertChannelDetails(const RsGxsChannelGroup &group)
}
ui->logoLabel->setPixmap(chanImage);
ui->subscribersLabel->setText(QString::number(group.mMeta.mPop)) ;
if (group.mMeta.mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_PUBLISH)
{
mStateHelper->setWidgetEnabled(ui->postButton, true);
@ -272,6 +270,9 @@ void GxsChannelPostsWidget::insertChannelDetails(const RsGxsChannelGroup &group)
ui->infoWidget->hide();
setViewMode(viewMode());
ui->subscribeToolButton->setText(tr("Subscribed") + " " + QString::number(group.mMeta.mPop) );
ui->infoPosts->clear();
ui->infoDescription->clear();
} else {
@ -332,6 +333,9 @@ void GxsChannelPostsWidget::insertChannelDetails(const RsGxsChannelGroup &group)
ui->feedToolButton->setEnabled(false);
ui->fileToolButton->setEnabled(false);
ui->subscribeToolButton->setText(tr("Subscribe ") + " " + QString::number(group.mMeta.mPop) );
}
}
@ -622,8 +626,6 @@ void GxsChannelPostsWidget::blank()
mStateHelper->setWidgetEnabled(ui->postButton, false);
mStateHelper->setWidgetEnabled(ui->subscribeToolButton, false);
ui->subscribersLabel->setText("") ;
clearPosts();
groupNameChanged(QString());

View File

@ -138,28 +138,6 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="subscribersLabel">
<property name="minimumSize">
<size>
<width>30</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Subscribers</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="postButton">
<property name="focusPolicy">