Permalink
Browse files

When you ctrl-click on a bookmark item in the bookmark toolbar open i…

…t in a new tab

Issue: 82
  • Loading branch information...
1 parent b5c5209 commit c0fb8a98c3cd3f85c243d2de78c93e11addb44f5 @icefox icefox committed Aug 1, 2008
Showing with 11 additions and 11 deletions.
  1. +11 −8 src/bookmarks.cpp
  2. +0 −3 src/bookmarks.h
View
@@ -919,26 +919,29 @@ BookmarkToolButton::BookmarkToolButton(QUrl url, QWidget *parent)
: QToolButton(parent)
, m_url(url)
{
- connect(this, SIGNAL(clicked()), this, SLOT(openBookmark()));
}
void BookmarkToolButton::mouseReleaseEvent(QMouseEvent *event)
{
QToolButton::mouseReleaseEvent(event);
- if (event->button() == Qt::MidButton)
- emit openBookmark(url(), TabWidget::NewTab, text());
+ if (hitButton(event->pos())) {
+ if (event->button() == Qt::MidButton)
+ emit openBookmark(url(), TabWidget::NewTab, text());
+ if (event->button() == Qt::LeftButton) {
+ TabWidget::Tab openLocation =
+ (event->modifiers() & Qt::ControlModifier)
+ ? TabWidget::NewTab
+ : TabWidget::CurrentTab;
+ emit openBookmark(url(), openLocation, text());
+ }
+ }
}
QUrl BookmarkToolButton::url() const
{
return m_url;
}
-void BookmarkToolButton::openBookmark()
-{
- emit openBookmark(url(), TabWidget::CurrentTab, text());
-}
-
BookmarksToolBar::BookmarksToolBar(BookmarksModel *model, QWidget *parent)
: QToolBar(tr("Bookmark"), parent)
, m_bookmarksModel(model)
View
@@ -329,9 +329,6 @@ class BookmarkToolButton : public QToolButton
protected:
void mouseReleaseEvent(QMouseEvent *event);
-private slots:
- void openBookmark();
-
private:
QUrl m_url;

0 comments on commit c0fb8a9

Please sign in to comment.