TOC context menu (part 1): Only scroll the document to the item when the user left-clicks on the item.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29154 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2009-04-08 17:39:14 +00:00
parent 336cb70ae2
commit f7f24a2709
2 changed files with 7 additions and 4 deletions

View File

@ -77,10 +77,13 @@ void TocWidget::on_tocTV_activated(QModelIndex const & index)
}
void TocWidget::on_tocTV_clicked(QModelIndex const & index)
void TocWidget::on_tocTV_pressed(QModelIndex const & index)
{
goTo(index);
gui_view_.setFocus();
Qt::MouseButtons const button = QApplication::mouseButtons();
if (button & Qt::LeftButton) {
goTo(index);
gui_view_.setFocus();
}
}

View File

@ -46,7 +46,7 @@ protected Q_SLOTS:
void goTo(QModelIndex const &);
void on_tocTV_activated(QModelIndex const &);
void on_tocTV_clicked(QModelIndex const &);
void on_tocTV_pressed(QModelIndex const &);
void on_updateTB_clicked();
void on_sortCB_stateChanged(int state);
void on_persistentCB_stateChanged(int state);