From a1ca31afa0ba3af6933171e037bbfc54491e5758 Mon Sep 17 00:00:00 2001 From: defnax Date: Fri, 29 Mar 2019 02:00:13 +0100 Subject: [PATCH] fixes from cyril & removed stylesheets from some buttons fixed size of thumbnail on all screens fixed aspect ratio removede the stylsheet for comments,share, notes --- retroshare-gui/src/gui/Posted/PostedItem.cpp | 17 +++++++++++------ retroshare-gui/src/gui/Posted/PostedItem.ui | 6 +++--- .../src/gui/gxs/GxsCommentTreeWidget.cpp | 2 +- .../src/gui/qss/stylesheet/Standard.qss | 6 +----- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/retroshare-gui/src/gui/Posted/PostedItem.cpp b/retroshare-gui/src/gui/Posted/PostedItem.cpp index d107b660d..9ad0aa839 100644 --- a/retroshare-gui/src/gui/Posted/PostedItem.cpp +++ b/retroshare-gui/src/gui/Posted/PostedItem.cpp @@ -246,20 +246,25 @@ void PostedItem::fill() return; } + QPixmap sqpixmap2 = QPixmap(":/images/thumb-default.png"); + mInFill = true; - + int desired_height = 1.5*(ui->voteDownButton->height() + ui->voteUpButton->height() + ui->scoreLabel->height()); + int desired_width = sqpixmap2.width()*desired_height/(float)sqpixmap2.height(); + if(mPost.mImage.mData != NULL) { QPixmap pixmap; pixmap.loadFromData(mPost.mImage.mData, mPost.mImage.mSize, "PNG"); // Wiping data - as its been passed to thumbnail. - QPixmap sqpixmap = pixmap.scaled(800, 600, Qt::KeepAspectRatio, Qt::SmoothTransformation); - ui->pictureLabel->setPixmap(sqpixmap); - - ui->thumbnailLabel->setPixmap(pixmap); - }else + QPixmap sqpixmap = pixmap.scaled(desired_width,desired_height, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation); + ui->thumbnailLabel->setPixmap(sqpixmap); + ui->pictureLabel->setPixmap(pixmap); + } + else { + //ui->thumbnailLabel->setFixedSize(desired_width,desired_height); ui->expandButton->setDisabled(true); } diff --git a/retroshare-gui/src/gui/Posted/PostedItem.ui b/retroshare-gui/src/gui/Posted/PostedItem.ui index d991b99ef..250f43007 100644 --- a/retroshare-gui/src/gui/Posted/PostedItem.ui +++ b/retroshare-gui/src/gui/Posted/PostedItem.ui @@ -6,8 +6,8 @@ 0 0 - 617 - 190 + 825 + 337 @@ -683,8 +683,8 @@ - + diff --git a/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp b/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp index a66b93b34..296ce68c8 100644 --- a/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp +++ b/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp @@ -542,7 +542,7 @@ void GxsCommentTreeWidget::service_loadThread(const uint32_t &token) text = qtime.toString("yyyy-MM-dd hh:mm:ss") ; item->setText(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))); } diff --git a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss index 8226d7f28..0c858f972 100644 --- a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss +++ b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss @@ -907,11 +907,7 @@ PostedItem QLabel#fromBoldLabel, QLabel#fromLabel, QLabel#dateLabel, QLabel#site color: #787c7e; } -PostedItem QToolButton#commentButton, QPushButton#shareButton, QToolButton#notesButton{ - font-size: 12px; - color: #878a8c; - font-weight: bold; -} + GxsCommentDialog QComboBox#sortBox { font: bold;