diff options
author | megabigbug <megabigbug@arrakis.(none)> | 2009-10-22 22:37:16 +0200 |
---|---|---|
committer | megabigbug <megabigbug@arrakis.(none)> | 2009-10-22 22:37:16 +0200 |
commit | beb6c722af620e4d5013b68601302a16db0fa66c (patch) | |
tree | bbcfffb1e14728b43712a31933a991610989712a /src | |
parent | rekonq 0.2.70 (diff) | |
download | rekonq-beb6c722af620e4d5013b68601302a16db0fa66c.tar.xz |
modify previewImage size
center "add preview" button
Diffstat (limited to 'src')
-rw-r--r-- | src/previewimage.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/previewimage.cpp b/src/previewimage.cpp index e7f8aea5..7869346b 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); @@ -96,6 +107,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)) @@ -165,10 +178,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()); |