From beb6c722af620e4d5013b68601302a16db0fa66c Mon Sep 17 00:00:00 2001 From: megabigbug Date: Thu, 22 Oct 2009 22:37:16 +0200 Subject: modify previewImage size center "add preview" button --- src/previewimage.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'src') 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()); -- cgit v1.2.1 From 895bcc7531351c71d4a5c0cb5c3221d59c312aad Mon Sep 17 00:00:00 2001 From: megabigbug Date: Thu, 22 Oct 2009 23:10:18 +0200 Subject: dynamic space between previews previews centered --- src/homepage.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/homepage.cpp b/src/homepage.cpp index 835be043..965bb749 100644 --- a/src/homepage.cpp +++ b/src/homepage.cpp @@ -112,7 +112,7 @@ QString HomePage::fillFavorites() QStringList names = ReKonfig::previewNames(); QStringList urls = ReKonfig::previewUrls(); - QString speed; + QString speed="
"; for(int i=0; i<8; ++i) { speed += "
"; @@ -123,7 +123,8 @@ QString HomePage::fillFavorites() speed += ""; speed += "
"; } - + + speed += "
"; return speed; } -- cgit v1.2.1