diff options
-rw-r--r-- | data/home.html | 16 | ||||
-rw-r--r-- | src/homepage.cpp | 5 | ||||
-rw-r--r-- | src/previewimage.cpp | 23 |
3 files changed, 37 insertions, 7 deletions
diff --git a/data/home.html b/data/home.html index d81af731..95e61011 100644 --- a/data/home.html +++ b/data/home.html @@ -108,13 +108,27 @@ margin-right: 4px; margin-left: 4px; } + +.favorites{ +text-align: center; +} + /* -------------------------------------------------------- */ /* Thumbnail class */ .thumbnail { text-align: center; -float:left; +display: inline-block; +width:25%; margin-bottom: 7%; +min-width:250px; +min-height:192px; +} + +.thumbnail object{ +text-align: center; +width:228px; +height:192px; } /* -------------------------------------------------------- */ 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="<div class=\"favorites\">"; for(int i=0; i<8; ++i) { speed += "<div class=\"thumbnail\">"; @@ -123,7 +123,8 @@ QString HomePage::fillFavorites() speed += "</object>"; speed += "</div>"; } - + + speed += "</div>"; return speed; } 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()); |