mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-25 07:29:33 -05:00
fixed size of thumbnail on all screens
This commit is contained in:
parent
94997bd0d3
commit
fcee6d3f63
@ -247,19 +247,26 @@ void PostedItem::fill()
|
|||||||
}
|
}
|
||||||
|
|
||||||
mInFill = true;
|
mInFill = true;
|
||||||
|
int desired_height = ui->voteDownButton->height() + ui->voteUpButton->height() + ui->scoreLabel->height();
|
||||||
if(mPost.mImage.mData != NULL)
|
if(mPost.mImage.mData != NULL)
|
||||||
{
|
{
|
||||||
QPixmap pixmap;
|
QPixmap pixmap;
|
||||||
pixmap.loadFromData(mPost.mImage.mData, mPost.mImage.mSize, "PNG");
|
pixmap.loadFromData(mPost.mImage.mData, mPost.mImage.mSize, "PNG");
|
||||||
// Wiping data - as its been passed to thumbnail.
|
// Wiping data - as its been passed to thumbnail.
|
||||||
|
|
||||||
QPixmap sqpixmap = pixmap.scaled(800, 600, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
QPixmap sqpixmap = pixmap.scaled(10*desired_height,1.5*desired_height, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||||
ui->pictureLabel->setPixmap(sqpixmap);
|
ui->thumbnailLabel->setMaximumSize(sqpixmap.size());
|
||||||
|
ui->thumbnailLabel->setPixmap(sqpixmap);
|
||||||
ui->thumbnailLabel->setPixmap(pixmap);
|
ui->pictureLabel->setPixmap(pixmap);
|
||||||
}else
|
std::cerr << "new size=" << desired_height << " " << sqpixmap.width() << " " << sqpixmap.height() << std::endl;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
|
QPixmap sqpixmap = QPixmap(":/images/thumb-default.png").scaled(10*desired_height,1.5*desired_height, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||||
|
|
||||||
|
ui->thumbnailLabel->setMaximumSize(sqpixmap.size());
|
||||||
|
ui->thumbnailLabel->setPixmap(sqpixmap);
|
||||||
|
|
||||||
ui->expandButton->setDisabled(true);
|
ui->expandButton->setDisabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>617</width>
|
<width>825</width>
|
||||||
<height>190</height>
|
<height>337</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -187,23 +187,11 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="thumbnailLabel">
|
<widget class="QLabel" name="thumbnailLabel">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>100</width>
|
|
||||||
<height>75</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>100</width>
|
|
||||||
<height>75</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true"/>
|
<string notr="true"/>
|
||||||
</property>
|
</property>
|
||||||
@ -683,8 +671,8 @@
|
|||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../images.qrc"/>
|
|
||||||
<include location="Posted_images.qrc"/>
|
<include location="Posted_images.qrc"/>
|
||||||
|
<include location="../images.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
@ -542,7 +542,7 @@ void GxsCommentTreeWidget::service_loadThread(const uint32_t &token)
|
|||||||
text = qtime.toString("yyyy-MM-dd hh:mm:ss") ;
|
text = qtime.toString("yyyy-MM-dd hh:mm:ss") ;
|
||||||
item->setText(PCITEM_COLUMN_DATE, text) ;
|
item->setText(PCITEM_COLUMN_DATE, text) ;
|
||||||
item->setToolTip(PCITEM_COLUMN_DATE, text) ;
|
item->setToolTip(PCITEM_COLUMN_DATE, text) ;
|
||||||
item->setData(PCITEM_COLUMN_DATE, ROLE_SORT, comment.mMeta.mPublishTs);
|
item->setData(PCITEM_COLUMN_DATE, ROLE_SORT, QVariant(qlonglong(comment.mMeta.mPublishTs)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user