summaryrefslogtreecommitdiff
path: root/src/previewimage.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-10-23 00:22:25 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-10-23 00:22:25 +0200
commit0f99c7511410649264882a57e13c154b3d3c8568 (patch)
tree32e779214367ccf4cf9aca84057bee6cf467264e /src/previewimage.cpp
parentMerge branch 'StartRekonq' (diff)
parentdynamic space between previews (diff)
downloadrekonq-0f99c7511410649264882a57e13c154b3d3c8568.tar.xz
Fixing merge..
Merge commit 'refs/merge-requests/1889' of git://gitorious.org/rekonq/mainline into Fri9 Conflicts: data/home.html
Diffstat (limited to 'src/previewimage.cpp')
-rw-r--r--src/previewimage.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/previewimage.cpp b/src/previewimage.cpp
index f5421fe3..f727db49 100644
--- a/src/previewimage.cpp
+++ b/src/previewimage.cpp
@@ -63,12 +63,23 @@ PreviewImage::PreviewImage(const QUrl &url, const QString &title, int index, boo
, m_imageLabel(new QLabel)
, m_textLabel(new QLabel)
{
- setMinimumSize(300,200);
-
+
+ int borderTop = 14;
+ int borderRight = 14;
+ int borderBottom = 14;
+ int borderLeft = 14;
+
+ int previewWidth=200;
+ int previewHeight=150;
+
+ int urlHeight=18;
+ setFixedSize(borderLeft+previewWidth+borderRight, borderTop+previewHeight+borderBottom+urlHeight);
+
m_imageLabel->setAlignment(Qt::AlignCenter);
m_textLabel->setAlignment(Qt::AlignCenter);
QVBoxLayout *mainLayout = new QVBoxLayout;
+ mainLayout->setMargin(0);
mainLayout->addWidget(m_imageLabel);
mainLayout->addWidget(m_textLabel);
setLayout(mainLayout);
@@ -98,6 +109,8 @@ void PreviewImage::loadUrlPreview(const QUrl& url)
return;
}
+ m_textLabel->setMaximumSize(QWIDGETSIZE_MAX,QWIDGETSIZE_MAX); //unhide
+
m_savePath = KStandardDirs::locateLocal("cache", QString("thumbs/") + guessNameFromUrl(m_url) + ".png", true);
if(QFile::exists(m_savePath))
@@ -170,10 +183,12 @@ void PreviewImage::showEmptyPreview()
{
if(!m_isFavorite)
return;
-
+
m_imageLabel->clear();
m_textLabel->clear();
-
+
+ m_textLabel->setMaximumSize(0,0); //hide (is there an other way for hide ?)
+
QHBoxLayout *layout = new QHBoxLayout(m_imageLabel);
m_button = new QToolButton(m_imageLabel);
m_button->setDefaultAction(historyMenu());