mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-17 13:24:15 -05:00
Merge pull request #2136 from defnax/zoomablelabel-for-channel-feeds
Added ZoomableLabel for the Channel Post Feeds
This commit is contained in:
commit
e0281e2a33
@ -432,27 +432,20 @@ void GxsChannelPostItem::fill()
|
|||||||
QString msgText;
|
QString msgText;
|
||||||
//float f = QFontMetricsF(font()).height()/14.0 ;
|
//float f = QFontMetricsF(font()).height()/14.0 ;
|
||||||
|
|
||||||
|
ui->logoLabel->setEnableZoom(false);
|
||||||
|
int desired_height = QFontMetricsF(font()).height() * 8;
|
||||||
|
ui->logoLabel->setFixedSize(4/3.0*desired_height,desired_height);
|
||||||
|
|
||||||
if(mPost.mThumbnail.mData != NULL)
|
if(mPost.mThumbnail.mData != NULL)
|
||||||
{
|
{
|
||||||
QPixmap thumbnail;
|
QPixmap thumbnail;
|
||||||
|
|
||||||
ui->logoLabel->setScaledContents(true);
|
|
||||||
|
|
||||||
GxsIdDetails::loadPixmapFromData(mPost.mThumbnail.mData, mPost.mThumbnail.mSize, thumbnail,GxsIdDetails::ORIGINAL);
|
GxsIdDetails::loadPixmapFromData(mPost.mThumbnail.mData, mPost.mThumbnail.mSize, thumbnail,GxsIdDetails::ORIGINAL);
|
||||||
// Wiping data - as its been passed to thumbnail.
|
// Wiping data - as its been passed to thumbnail.
|
||||||
// if( thumbnail.width() < 90 ){
|
|
||||||
// ui->logoLabel->setMaximumSize(82*f,108*f);
|
ui->logoLabel->setPicture(thumbnail);
|
||||||
// }
|
|
||||||
// else if( thumbnail.width() < 109 ){
|
|
||||||
// ui->logoLabel->setMinimumSize(108*f,108*f);
|
|
||||||
// ui->logoLabel->setMaximumSize(108*f,108*f);
|
|
||||||
// }
|
|
||||||
// else{
|
|
||||||
// ui->logoLabel->setMinimumSize(156*f,108*f);
|
|
||||||
// ui->logoLabel->setMaximumSize(156*f,108*f);
|
|
||||||
// }
|
|
||||||
ui->logoLabel->setPixmap(thumbnail);
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
ui->logoLabel->setPicture( FilesDefs::getPixmapFromQtResourcePath(":/images/thumb-default-video.png") );
|
||||||
|
|
||||||
if( !IS_GROUP_PUBLISHER(mGroupMeta.mSubscribeFlags) )
|
if( !IS_GROUP_PUBLISHER(mGroupMeta.mSubscribeFlags) )
|
||||||
ui->editButton->hide() ;
|
ui->editButton->hide() ;
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="logoLabel">
|
<widget class="ZoomableLabel" name="logoLabel">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
@ -475,6 +475,11 @@
|
|||||||
<header location="global">gui/common/ElidedLabel.h</header>
|
<header location="global">gui/common/ElidedLabel.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>ZoomableLabel</class>
|
||||||
|
<extends>QLabel</extends>
|
||||||
|
<header>gui/gxschannels/GxsChannelPostThumbnail.h</header>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user