┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/infosidebarpage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/infosidebarpage.cpp')
-rw-r--r--src/infosidebarpage.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/infosidebarpage.cpp b/src/infosidebarpage.cpp
index bcb28aa19..943033876 100644
--- a/src/infosidebarpage.cpp
+++ b/src/infosidebarpage.cpp
@@ -69,7 +69,7 @@ InfoSidebarPage::InfoSidebarPage(QWidget* parent) :
// preview
m_preview = new PixmapViewer(this);
m_preview->setMinimumWidth(KIconLoader::SizeEnormous);
- m_preview->setFixedHeight(KIconLoader::SizeEnormous);
+ m_preview->setMinimumHeight(KIconLoader::SizeEnormous);
// name
m_nameLabel = new QLabel(this);
@@ -169,6 +169,23 @@ void InfoSidebarPage::resizeEvent(QResizeEvent* event)
const int maxWidth = event->size().width() - KDialog::spacingHint() * 4;
m_nameLabel->setMaximumWidth(maxWidth);
m_infoLabel->setMaximumWidth(maxWidth);
+
+ // try to increase the preview as large as possible
+ m_preview->setSizeHint(QSize(maxWidth, maxWidth));
+
+ // ---
+ // TODO: The following workaround was not necessary with Qt 4.3.x
+ // but is mandatory with the current Qt4.4 beta version. Check with
+ // Qt 4.4.0 whether the issue is Dolphin specific
+ // (see PixmapViewer::setSizeHint()) or a regression in Qt.
+ QVBoxLayout* vBox = static_cast<QVBoxLayout*>(layout());
+ vBox->removeWidget(m_preview);
+ vBox->insertWidget(0, m_preview);
+ // ---
+
+ m_urlCandidate = m_shownUrl; // reset the URL candidate if a resizing is done
+ m_timer->start(TimerDelay);
+
SidebarPage::resizeEvent(event);
}
@@ -196,7 +213,7 @@ void InfoSidebarPage::showItemInfo()
KIconLoader iconLoader;
QPixmap icon = iconLoader.loadIcon("system-run",
KIconLoader::NoGroup,
- KIconLoader::SizeEnormous);
+ m_preview->width());
m_preview->setPixmap(icon);
m_nameLabel->setText(i18ncp("@info", "%1 item selected", "%1 items selected", selectedItems.count()));
} else if (!applyPlace(file)) {
@@ -209,7 +226,7 @@ void InfoSidebarPage::showItemInfo()
KIO::PreviewJob* job = KIO::filePreview(list,
m_preview->width(),
- KIconLoader::SizeEnormous,
+ m_preview->height(),
0,
0,
true,