added system to clamp the text in thumbnails

This commit is contained in:
csoler 2020-08-25 11:50:12 +02:00
parent 262d36cc82
commit 9e20c04e3f
3 changed files with 14 additions and 5 deletions

View File

@ -98,7 +98,7 @@ public:
lb->setFixedSize(W,H);
lb->setPixmap(thumbnail);
lt->setText(msg);
setText(msg);
QFont font = lt->font();
@ -116,7 +116,16 @@ public:
}
void setPixmap(const QPixmap& p) { lb->setPixmap(p); }
void setText(const QString& s) { lt->setText(s); }
void setText(const QString& s)
{
QString ss;
if(s.length() > 30)
ss = s.left(30)+"...";
else
ss =s;
lt->setText(ss);
}
private:
QLabel *lb;

View File

@ -262,7 +262,7 @@ GxsChannelPostsWidgetWithModel::GxsChannelPostsWidgetWithModel(const RsGxsGroupI
ui->postTime_LB->hide();
ui->postLogo_LB->hide();
ui->postDetails_TE->setPlaceholderText(tr("No post selected"));
ui->postDetails_TE->setPlaceholderText(tr("No text to display"));
// Set initial size of the splitter
ui->splitter->setStretchFactor(0, 1);

View File

@ -161,7 +161,7 @@
<item>
<widget class="QTabWidget" name="channel_TW">
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="tab_3">
<attribute name="title">
@ -526,7 +526,7 @@ p, li { white-space: pre-wrap; }
</widget>
<widget class="QWidget" name="tab_5">
<attribute name="title">
<string>Files</string>
<string>All files</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>