diff options
-rw-r--r-- | src/homepage.cpp | 4 | ||||
-rw-r--r-- | src/previewimage.cpp | 20 | ||||
-rw-r--r-- | src/previewimage.h | 5 | ||||
-rw-r--r-- | src/websnap.cpp | 9 | ||||
-rw-r--r-- | src/websnap.h | 1 | ||||
-rw-r--r-- | src/webview.cpp | 9 | ||||
-rw-r--r-- | src/webview.h | 1 |
7 files changed, 44 insertions, 5 deletions
diff --git a/src/homepage.cpp b/src/homepage.cpp index 6aef42a9..3cc908a9 100644 --- a/src/homepage.cpp +++ b/src/homepage.cpp @@ -120,7 +120,7 @@ QString HomePage::fillFavorites() speed += "<object type=\"application/image-preview\" data=\""; speed += urls.at(i) + "\" width=\"200\">"; speed += "</object>"; - speed += "<br /><br />"; + speed += "<br />"; speed += "<a href=\"" + urls.at(i) + "\">" + text + "</a></div>"; } @@ -154,7 +154,7 @@ QString HomePage::lastVisitedSites() last += "<object type=\"application/image-preview\" data=\"" + son.data(HistoryModel::UrlStringRole).toString(); last += "\" width=\"200\">"; last += "</object>"; - last += "<br /><br />"; + last += "<br />"; last += "<a href=\"" + son.data(HistoryModel::UrlStringRole).toString() + "\">" + text + "</a></div>"; sites++; } diff --git a/src/previewimage.cpp b/src/previewimage.cpp index 07eca1b0..7c3752cc 100644 --- a/src/previewimage.cpp +++ b/src/previewimage.cpp @@ -71,6 +71,7 @@ PreviewImage::PreviewImage(const QUrl &url) PreviewImage::~PreviewImage() { + delete ws; } @@ -87,6 +88,19 @@ void PreviewImage::setSiteImage() } +void PreviewImage::mouseDoubleClickEvent(QMouseEvent *event) +{ + Q_UNUSED(event); +} + + +void PreviewImage::mouseMoveEvent(QMouseEvent *event) +{ + kDebug() << "moving mouse over preview image"; + Q_UNUSED(event) +} + + void PreviewImage::mousePressEvent(QMouseEvent *event) { switch(event->button()) @@ -103,6 +117,12 @@ void PreviewImage::mousePressEvent(QMouseEvent *event) } +void PreviewImage::mouseReleaseEvent(QMouseEvent *event) +{ + Q_UNUSED(event) +} + + QString PreviewImage::guessNameFromUrl(QUrl url) { QString name = url.toString( QUrl::RemoveScheme | QUrl::RemoveUserInfo | QUrl::StripTrailingSlash ); diff --git a/src/previewimage.h b/src/previewimage.h index b3f184aa..6ccc5c97 100644 --- a/src/previewimage.h +++ b/src/previewimage.h @@ -49,8 +49,11 @@ public slots: void setSiteImage(); protected: + void mouseDoubleClickEvent(QMouseEvent *event); + void mouseMoveEvent(QMouseEvent *event); void mousePressEvent(QMouseEvent *event); - + void mouseReleaseEvent(QMouseEvent *event); + private: QPixmap m_pixmap; WebSnap *ws; diff --git a/src/websnap.cpp b/src/websnap.cpp index 35f1cd39..9e7108b0 100644 --- a/src/websnap.cpp +++ b/src/websnap.cpp @@ -63,6 +63,11 @@ WebSnap::WebSnap(const QUrl &url) } +WebSnap::~WebSnap() +{ +} + + void WebSnap::load() { m_page.mainFrame()->load(m_url); @@ -72,8 +77,8 @@ void WebSnap::load() QPixmap WebSnap::renderPreview(const QWebPage &page,int w, int h) { // prepare page - page.mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff); //Why it doesn't work with one setScrollBarPolicy ? bug in qtwebkit ? - page.mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff); + page.mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff); // Why it doesn't work with one setScrollBarPolicy? + page.mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff); // bug in qtwebkit ? page.mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff); page.mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff); diff --git a/src/websnap.h b/src/websnap.h index 7417456b..9a41f65d 100644 --- a/src/websnap.h +++ b/src/websnap.h @@ -48,6 +48,7 @@ class WebSnap : public QObject public: WebSnap(const QUrl &url); + ~WebSnap(); QPixmap previewImage(); static QPixmap renderPreview(const QWebPage &page, int w, int h); diff --git a/src/webview.cpp b/src/webview.cpp index 1c46041c..68311315 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -341,6 +341,15 @@ void WebView::mousePressEvent(QMouseEvent *event) } +void WebView::mouseMoveEvent(QMouseEvent *event) +{ + if( url().protocol() != "rekonq" ) + { + QWebView::mouseMoveEvent(event); + } +} + + void WebView::wheelEvent(QWheelEvent *event) { if (QApplication::keyboardModifiers() & Qt::ControlModifier) diff --git a/src/webview.h b/src/webview.h index 4dc7306d..0b4614a1 100644 --- a/src/webview.h +++ b/src/webview.h @@ -55,6 +55,7 @@ public: protected: void contextMenuEvent(QContextMenuEvent *event); void mousePressEvent(QMouseEvent *event); + void mouseMoveEvent(QMouseEvent *event); void wheelEvent(QWheelEvent *event); private slots: |