Put template preview and description text into single frame

parent 3f43a376
This diff is collapsed.
...@@ -143,6 +143,11 @@ void ChoicePage::itemSelected(const QModelIndex &index) ...@@ -143,6 +143,11 @@ void ChoicePage::itemSelected(const QModelIndex &index)
if (picture.isNull()) { if (picture.isNull()) {
ui_choice.pictureLabel->setText(i18n("No sample picture available.")); ui_choice.pictureLabel->setText(i18n("No sample picture available."));
} else { } else {
const QSize labelSize = ui_choice.pictureLabel->minimumSize();
if ((labelSize.height() < picture.height() || labelSize.width() < picture.width()) ||
(labelSize.height() > picture.height()*2 || labelSize.width() > picture.width()*2)) {
picture = picture.scaled(labelSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
}
ui_choice.pictureLabel->setPixmap(picture); ui_choice.pictureLabel->setPixmap(picture);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment