diff --git a/articleview.cc b/articleview.cc index c4ab91de..b08fb7b5 100644 --- a/articleview.cc +++ b/articleview.cc @@ -106,6 +106,11 @@ ArticleView::ArticleView( QWidget * parent, ArticleNetworkAccessManager & nm, ui.definition->pageAction( QWebPage::Copy )->setShortcut( QKeySequence::Copy ); ui.definition->addAction( ui.definition->pageAction( QWebPage::Copy ) ); + QAction * selectAll = ui.definition->pageAction( QWebPage::SelectAll ); + selectAll->setShortcut( QKeySequence::SelectAll ); + selectAll->setShortcutContext( Qt::WidgetWithChildrenShortcut ); + ui.definition->addAction( selectAll ); + ui.definition->setContextMenuPolicy( Qt::CustomContextMenu ); ui.definition->page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks ); @@ -1109,10 +1114,7 @@ void ArticleView::contextMenuRequested( QPoint const & pos ) } } - if ( selectedText.size() ) - menu.addAction( ui.definition->pageAction( QWebPage::Copy ) ); - - if( menu.isEmpty() && !cfg.preferences.storeHistory) + if( selectedText.isEmpty() && !cfg.preferences.storeHistory) { addHeaderToHistoryAction = new QAction( tr( "&Add \"%1\" to history" ). arg( ui.definition->title() ), @@ -1120,6 +1122,15 @@ void ArticleView::contextMenuRequested( QPoint const & pos ) menu.addAction( addHeaderToHistoryAction ); } + if ( selectedText.size() ) + { + menu.addAction( ui.definition->pageAction( QWebPage::Copy ) ); + } + else + { + menu.addAction( ui.definition->pageAction( QWebPage::SelectAll ) ); + } + map< QAction *, QString > tableOfContents; // Add table of contents diff --git a/historypanewidget.cc b/historypanewidget.cc index 8120edb8..68687362 100644 --- a/historypanewidget.cc +++ b/historypanewidget.cc @@ -192,7 +192,7 @@ void HistoryPaneWidget::onSelectionChanged( QItemSelection const & selection ) return; itemSelectionChanged = true; - emitHistoryItemRequested( selection.front().bottomRight() ); + emitHistoryItemRequested( selection.front().topLeft() ); } void HistoryPaneWidget::onItemClicked( QModelIndex const & idx )