diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-09-20 02:08:34 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-09-20 02:08:34 +0200 |
commit | 4f6f43ddcc24da50e4c1da0c3923d6af75fc527e (patch) | |
tree | b76bd3feeccfbe23313d548e1bef0669f8526399 | |
parent | Fixing loading preview (diff) | |
download | rekonq-4f6f43ddcc24da50e4c1da0c3923d6af75fc527e.tar.xz |
Fixing websnap resizing...
-rw-r--r-- | src/homepage.cpp | 3 | ||||
-rw-r--r-- | src/websnap.cpp | 9 |
2 files changed, 5 insertions, 7 deletions
diff --git a/src/homepage.cpp b/src/homepage.cpp index 14db5806..aa679999 100644 --- a/src/homepage.cpp +++ b/src/homepage.cpp @@ -95,13 +95,12 @@ QString HomePage::speedDial() for(int i = 0; i< urls.count(); ++i) { speed += "<div class=\"thumbnail\">"; - speed += "<a href=\"" + urls.at(i) + "\">"; speed += "<object type=\"application/image-preview\" width=\"200\">"; speed += "<param name=\"url\" value=\"" + urls.at(i) + "\">"; speed += "<param name=\"position\" value=\"" + QString::number(i) + "\">"; speed += "</object>"; speed += "<br />"; - speed += names.at(i) + "</a></div>"; + speed += "<a href=\"" + urls.at(i) + "\">" + names.at(i) + "</a></div>"; } return speed; } diff --git a/src/websnap.cpp b/src/websnap.cpp index 94560891..c669dee0 100644 --- a/src/websnap.cpp +++ b/src/websnap.cpp @@ -71,17 +71,16 @@ void WebSnap::saveResult(bool ok) return; } - // find proper size, we stick to sensible aspect ratio + // find proper image size and later resize it.. QSize size = m_page.mainFrame()->contentsSize(); - size.setHeight(size.width() * HEIGHT / WIDTH ); - + // create the target surface - m_image = QPixmap(WIDTH, HEIGHT); + m_image = QPixmap( size ); m_image.fill(Qt::transparent); // render and rescale QPainter p(&m_image); - m_page.setViewportSize(m_page.mainFrame()->contentsSize()); + m_page.setViewportSize( size ); m_page.mainFrame()->render(&p); p.end(); m_image = m_image.scaled(WIDTH, HEIGHT, Qt::KeepAspectRatioByExpanding); |