mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-14 08:59:50 -05:00
Merge pull request #2587 from csoler/v0.6-BugFixing_16
Bug fixing in PostedItem
This commit is contained in:
commit
1ddba795d4
@ -1 +1 @@
|
|||||||
Subproject commit 87fdae942186ab3412ce40438e30f76670dd55d0
|
Subproject commit 1965f200033cc6a5bbf46fcda21e87248b181076
|
@ -495,7 +495,7 @@ void PostedItem::fill()
|
|||||||
ui->voteUpButton->setDisabled(true);
|
ui->voteUpButton->setDisabled(true);
|
||||||
ui->voteDownButton->setDisabled(true);
|
ui->voteDownButton->setDisabled(true);
|
||||||
|
|
||||||
ui->thumbnailLabel->setPixmap( FilesDefs::getPixmapFromQtResourcePath(":/images/thumb-default.png"));
|
ui->thumbnailLabel->setPicture( FilesDefs::getPixmapFromQtResourcePath(":/images/thumb-default.png"));
|
||||||
ui->fromLabel->setId(mPost.mMeta.mAuthorId);
|
ui->fromLabel->setId(mPost.mMeta.mAuthorId);
|
||||||
ui->titleLabel->setText(tr( "<p><font color=\"#ff0000\"><b>The author of this message (with ID %1) is banned.</b>").arg(QString::fromStdString(mPost.mMeta.mAuthorId.toStdString()))) ;
|
ui->titleLabel->setText(tr( "<p><font color=\"#ff0000\"><b>The author of this message (with ID %1) is banned.</b>").arg(QString::fromStdString(mPost.mMeta.mAuthorId.toStdString()))) ;
|
||||||
QDateTime qtime;
|
QDateTime qtime;
|
||||||
@ -509,8 +509,10 @@ void PostedItem::fill()
|
|||||||
QPixmap sqpixmap2 = FilesDefs::getPixmapFromQtResourcePath(":/images/thumb-default.png");
|
QPixmap sqpixmap2 = FilesDefs::getPixmapFromQtResourcePath(":/images/thumb-default.png");
|
||||||
|
|
||||||
mInFill = true;
|
mInFill = true;
|
||||||
int desired_height = 1.5*(ui->voteDownButton->height() + ui->voteUpButton->height() + ui->scoreLabel->height());
|
int desired_height = ui->voteDownButton->height() + ui->voteUpButton->height() + ui->scoreLabel->height();
|
||||||
int desired_width = sqpixmap2.width()*desired_height/(float)sqpixmap2.height();
|
int desired_width = 16/9.0 * desired_height; //sqpixmap2.width()*desired_height/(float)sqpixmap2.height();
|
||||||
|
|
||||||
|
ui->thumbnailLabel->setFixedSize(desired_width,desired_height);
|
||||||
|
|
||||||
QDateTime qtime;
|
QDateTime qtime;
|
||||||
qtime.setTime_t(mPost.mMeta.mPublishTs);
|
qtime.setTime_t(mPost.mMeta.mPublishTs);
|
||||||
@ -573,17 +575,17 @@ void PostedItem::fill()
|
|||||||
GxsIdDetails::loadPixmapFromData(mPost.mImage.mData, mPost.mImage.mSize, pixmap,GxsIdDetails::ORIGINAL);
|
GxsIdDetails::loadPixmapFromData(mPost.mImage.mData, mPost.mImage.mSize, pixmap,GxsIdDetails::ORIGINAL);
|
||||||
// Wiping data - as its been passed to thumbnail.
|
// Wiping data - as its been passed to thumbnail.
|
||||||
|
|
||||||
QPixmap sqpixmap = pixmap.scaled(desired_width,desired_height, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation);
|
// QPixmap sqpixmap = pixmap.scaled(desired_width,desired_height, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation);
|
||||||
ui->thumbnailLabel->setPixmap(sqpixmap);
|
ui->thumbnailLabel->setPicture(pixmap);
|
||||||
ui->thumbnailLabel->setToolTip(tr("Click to view Picture"));
|
ui->thumbnailLabel->setToolTip(tr("Click to view Picture"));
|
||||||
|
ui->thumbnailLabel->setEnableZoom(false);
|
||||||
|
|
||||||
QPixmap scaledpixmap;
|
QPixmap scaledpixmap;
|
||||||
if(pixmap.width() > 800){
|
if(pixmap.width() > 800){
|
||||||
QPixmap scaledpixmap = pixmap.scaledToWidth(800, Qt::SmoothTransformation);
|
QPixmap scaledpixmap = pixmap.scaledToWidth(800, Qt::SmoothTransformation);
|
||||||
ui->pictureLabel->setPixmap(scaledpixmap);
|
ui->pictureLabel->setPixmap(scaledpixmap);
|
||||||
}else{
|
}else
|
||||||
ui->pictureLabel->setPixmap(pixmap);
|
ui->pictureLabel->setPixmap(pixmap);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (urlOkay && (mPost.mImage.mData == NULL))
|
else if (urlOkay && (mPost.mImage.mData == NULL))
|
||||||
{
|
{
|
||||||
|
@ -112,11 +112,11 @@ protected:
|
|||||||
void setCommentsSize(int comNb) override;
|
void setCommentsSize(int comNb) override;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void doExpand(bool open);
|
void doExpand(bool open) override;
|
||||||
void toggle();
|
void toggle() override;
|
||||||
void makeUpVote();
|
void makeUpVote() override;
|
||||||
void makeDownVote();
|
void makeDownVote() override;
|
||||||
void toggleNotes() ;
|
void toggleNotes() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/** Qt Designer generated object */
|
/** Qt Designer generated object */
|
||||||
|
@ -176,6 +176,12 @@
|
|||||||
<property name="sizeType">
|
<property name="sizeType">
|
||||||
<enum>QSizePolicy::Expanding</enum>
|
<enum>QSizePolicy::Expanding</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
@ -190,7 +196,7 @@
|
|||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="ClickableLabel" name="thumbnailLabel">
|
<widget class="ZoomableLabel" name="thumbnailLabel">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
@ -732,15 +738,15 @@
|
|||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>ClickableLabel</class>
|
<class>ZoomableLabel</class>
|
||||||
<extends>QLabel</extends>
|
<extends>QLabel</extends>
|
||||||
<header>util/ClickableLabel.h</header>
|
<header>gui/gxschannels/GxsChannelPostThumbnail.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../images.qrc"/>
|
<include location="../images.qrc"/>
|
||||||
<include location="../icons.qrc"/>
|
|
||||||
<include location="Posted_images.qrc"/>
|
<include location="Posted_images.qrc"/>
|
||||||
|
<include location="../icons.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
Loading…
Reference in New Issue
Block a user