]> git.lyx.org Git - features.git/commitdiff
TOC context menu (part 1): Only scroll the document to the item when the user left...
authorVincent van Ravesteijn <vfr@lyx.org>
Wed, 8 Apr 2009 17:39:14 +0000 (17:39 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Wed, 8 Apr 2009 17:39:14 +0000 (17:39 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29154 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/TocWidget.cpp
src/frontends/qt4/TocWidget.h

index d9de4b6273f6a7950c96f3281198ad97a459ce57..a47d5daa2e37d104bc3d0aa6ac7b55b013bd75a1 100644 (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();
+       }
 }
 
 
index cfac929c9471c4349a93eabebfe2fd7321a9f32d..a291ef5bc74dd19833011e3f171c632877604ae5 100644 (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);