diff options
author | Yoann Laissus <yoann.laissus@gmail.com> | 2010-08-20 15:30:03 +0200 |
---|---|---|
committer | Yoann Laissus <yoann.laissus@gmail.com> | 2010-08-20 15:30:03 +0200 |
commit | 79ad6230fd3a99e13ed5ee18cba10c90cff3ee5c (patch) | |
tree | 9740b7d4de3c1c78e0a8cf2e31b554e954090db5 /src/mainwindow.cpp | |
parent | Fixed tooltip in the bookmarks panel (diff) | |
download | rekonq-79ad6230fd3a99e13ed5ee18cba10c90cff3ee5c.tar.xz |
- The bookmark toolbar is now a real toolbar, not an action.
It fixes the problem of the submenu if there are too much items to fit on the bar
- Improve a bit the new redesign of BookmarkOwner
- Reenable the bookmark menu by default (because the icon in the bar is on the left)
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r-- | src/mainwindow.cpp | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 1479e477..f0cb5e61 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -58,6 +58,7 @@ #include <KShortcut> #include <KStandardAction> #include <KAction> +#include <KEditToolBar> #include <KToggleFullScreenAction> #include <KActionCollection> #include <KMessageBox> @@ -106,7 +107,7 @@ MainWindow::MainWindow() , m_analyzerPanel(0) , m_historyBackMenu(0) , m_encodingMenu(new KMenu(this)) - , m_bookmarksBar(new BookmarkToolBar(QString("BookmarkToolBar"), this, Qt::TopToolBarArea, true, false, true)) + , m_bookmarksBar(0) , m_popup(new KPassivePopup(this)) , m_hidePopup(new QTimer(this)) { @@ -198,15 +199,35 @@ void MainWindow::setupToolbars() KToolBar *mainBar = toolBar("mainToolBar"); - // bookmarks bar - KAction *bookmarkBarAction = Application::bookmarkProvider()->bookmarkToolBarAction(m_bookmarksBar); - a = actionCollection()->addAction( QL1S("bookmarks_bar"), bookmarkBarAction); - mainBar->show(); // this just to fix reopening rekonq after fullscreen close +} + + +void MainWindow::initBookmarkBar() +{ + KToolBar *XMLGUIBkBar = toolBar("bookmarkToolBar"); + if (!XMLGUIBkBar) + return; + + if (m_bookmarksBar) + { + Application::bookmarkProvider()->removeToolBar(m_bookmarksBar); + delete m_bookmarksBar; + } + m_bookmarksBar = new BookmarkToolBar(XMLGUIBkBar, this); + Application::bookmarkProvider()->registerBookmarkBar(m_bookmarksBar); +} + - // =========== Bookmarks ToolBar ================================ - m_bookmarksBar->setAcceptDrops(true); - Application::bookmarkProvider()->setupBookmarkBar(m_bookmarksBar); +void MainWindow::configureToolbars() +{ + if (autoSaveSettings()) + saveAutoSaveSettings(); + + KEditToolBar dlg(factory(), this); + // The bookmark bar needs to be refill after the UI changes are finished + connect(&dlg, SIGNAL(newToolBarConfig()), this, SLOT(initBookmarkBar())); + dlg.exec(); } @@ -253,6 +274,9 @@ void MainWindow::postLaunch() // accept d'n'd setAcceptDrops(true); + + // Bookmark ToolBar (needs to be setup after the call to setupGUI()) + initBookmarkBar(); } |