diff options
-rw-r--r-- | src/mainwindow.cpp | 39 | ||||
-rw-r--r-- | src/mainwindow.h | 4 | ||||
-rw-r--r-- | src/urlbar/bookmarkwidget.cpp | 17 | ||||
-rw-r--r-- | src/urlbar/urlbar.cpp | 2 | ||||
-rw-r--r-- | src/webview.cpp | 12 |
5 files changed, 39 insertions, 35 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index cbef274a..73779627 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -211,19 +211,7 @@ void MainWindow::setupToolbars() void MainWindow::postLaunch() { - KToolBar *mainBar = toolBar("mainToolBar"); - - QToolButton *bookmarksButton = qobject_cast<QToolButton*>(mainBar->widgetForAction(actionByName( QL1S("bookmarksActionMenu") ))); - if(bookmarksButton) - { - connect(actionByName(QL1S("bookmarksActionMenu")), SIGNAL(triggered()), bookmarksButton, SLOT(showMenu())); - } - - QToolButton *toolsButton = qobject_cast<QToolButton*>(mainBar->widgetForAction(actionByName( QL1S("rekonq_tools") ))); - if(toolsButton) - { - connect(actionByName(QL1S("rekonq_tools")), SIGNAL(triggered()), toolsButton, SLOT(showMenu())); - } + setupBookmarksAndToolsShortcuts(); // setting popup notification m_popup->setAutoDelete(false); @@ -1343,3 +1331,28 @@ bool MainWindow::queryClose() } return true; } + + +void MainWindow::saveNewToolbarConfig() +{ + KXmlGuiWindow::saveNewToolbarConfig(); + setupBookmarksAndToolsShortcuts(); +} + + +void MainWindow::setupBookmarksAndToolsShortcuts() +{ + KToolBar *mainBar = toolBar("mainToolBar"); + + QToolButton *bookmarksButton = qobject_cast<QToolButton*>(mainBar->widgetForAction(actionByName( QL1S("bookmarksActionMenu") ))); + if(bookmarksButton) + { + connect(actionByName(QL1S("bookmarksActionMenu")), SIGNAL(triggered()), bookmarksButton, SLOT(showMenu())); + } + + QToolButton *toolsButton = qobject_cast<QToolButton*>(mainBar->widgetForAction(actionByName( QL1S("rekonq_tools") ))); + if(toolsButton) + { + connect(actionByName(QL1S("rekonq_tools")), SIGNAL(triggered()), toolsButton, SLOT(showMenu())); + } +} diff --git a/src/mainwindow.h b/src/mainwindow.h index e5a43649..50c73b4b 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -81,6 +81,7 @@ public: void setWidgetsVisible(bool makeFullScreen); private: + void setupBookmarksAndToolsShortcuts(); void setupActions(); void setupTools(); void setupToolbars(); @@ -108,6 +109,9 @@ signals: void ctrlTabPressed(); void shiftCtrlTabPressed(); +protected slots: + void saveNewToolbarConfig(); + protected: /** * Filters (SHIFT + ) CTRL + TAB events and emit (shift)ctrlTabPressed() diff --git a/src/urlbar/bookmarkwidget.cpp b/src/urlbar/bookmarkwidget.cpp index 3380ec57..ccfe4914 100644 --- a/src/urlbar/bookmarkwidget.cpp +++ b/src/urlbar/bookmarkwidget.cpp @@ -152,21 +152,6 @@ void BookmarkWidget::showAt(const QPoint &pos) void BookmarkWidget::removeBookmark() { - bool folder = m_bookmark.isGroup(); - - if (KMessageBox::warningContinueCancel( - QApplication::activeWindow(), - folder ? i18n("Are you sure you wish to remove the bookmark folder\n\"%1\"?", m_bookmark.text()) - : i18n("Are you sure you wish to remove the bookmark\n\"%1\"?", m_bookmark.text()), - folder ? i18n("Bookmark Folder Deletion") - : i18n("Bookmark Deletion"), - KStandardGuiItem::del()) - == KMessageBox::Continue - ) - { - m_bookmark.parentGroup().deleteBookmark(m_bookmark); - Application::bookmarkProvider()->bookmarkManager()->emitChanged(); - } - + Application::bookmarkProvider()->bookmarkOwner()->deleteBookmark(m_bookmark); reject(); } diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp index e2033120..0d130b94 100644 --- a/src/urlbar/urlbar.cpp +++ b/src/urlbar/urlbar.cpp @@ -312,10 +312,12 @@ void UrlBar::loadFinished() if (Application::bookmarkProvider()->bookmarkForUrl(_tab->url()).isNull()) { _icon->setIcon(KIcon("bookmarks").pixmap(32,32, QIcon::Disabled)); + _icon->setToolTip(i18n("Bookmark this page")); } else { _icon->setIcon(KIcon("bookmarks")); + _icon->setToolTip(i18n("Edit this bookmark")); } // show KGet downloads?? diff --git a/src/webview.cpp b/src/webview.cpp index 441225af..b710719f 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -536,13 +536,11 @@ void WebView::keyPressEvent(QKeyEvent *event) } - - - void WebView::wheelEvent(QWheelEvent *event) { - if (!ReKonfig::smoothScrolling() || page()->currentFrame()->hitTestContent(event->pos()).isContentEditable()) - KWebView::wheelEvent(event); + // To let some websites (eg: google maps) to handle wheel events + int ypos = page()->currentFrame()->scrollPosition().y(); + KWebView::wheelEvent(event); // Sync with the zoom slider if (event->modifiers() == Qt::ControlModifier) @@ -560,8 +558,10 @@ void WebView::wheelEvent(QWheelEvent *event) emit zoomChanged(newFactor); } - else if ( ReKonfig::smoothScrolling() && !page()->currentFrame()->hitTestContent(event->pos()).isContentEditable()) + else if (ReKonfig::smoothScrolling() && ypos != page()->currentFrame()->scrollPosition().y()) { + page()->currentFrame()->setScrollPosition(QPoint(page()->currentFrame()->scrollPosition().x(), ypos)); + int numDegrees = event->delta() / 8; int numSteps = numDegrees / 15; |