[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kate/part
From:       Dominik Haumann <dhdev () gmx ! de>
Date:       2006-08-29 16:19:28
Message-ID: 1156868368.668664.4844.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 578561 by dhaumann:

 * make middle mouse button clicks on scrollbar work
 * Scroll to Top/Bottom of the document instead of the view when Top/Bottom
   from the scrollbar's context menu is invoked.


 M  +6 -1      kateviewhelpers.cpp  
 M  +4 -3      kateviewinternal.cpp  


--- trunk/KDE/kdelibs/kate/part/kateviewhelpers.cpp #578560:578561
@@ -232,8 +232,13 @@
 
 void KateScrollBar::sliderMaybeMoved(int value)
 {
-  if (m_middleMouseDown)
+  if (m_middleMouseDown) {
+    // we only need to emit this signal once, as for the following slider
+    // movements the signal sliderMoved() is already emitted.
+    // Thus, set m_middleMouseDown to false right away.
+    m_middleMouseDown = false;
     emit sliderMMBMoved(value);
+  }
 }
 //END
 
--- trunk/KDE/kdelibs/kate/part/kateviewinternal.cpp #578560:578561
@@ -145,6 +145,7 @@
   // Hijack the line scroller's controls, so we can scroll nicely for word-wrap
   connect(m_lineScroll, SIGNAL(actionTriggered(int)), SLOT(scrollAction(int)));
   connect(m_lineScroll, SIGNAL(sliderMoved(int)), SLOT(scrollLines(int)));
+  connect(m_lineScroll, SIGNAL(sliderMMBMoved(int)), SLOT(scrollLines(int)));
 
   // catch wheel events, completing the hijack
   //m_lineScroll->installEventFilter(this);
@@ -376,7 +377,7 @@
 
 void KateViewInternal::scrollAction( int action )
 {
-  switch (action) {
+  switch  (action) {
     case QAbstractSlider::SliderSingleStepAdd:
       scrollNextLine();
       break;
@@ -394,11 +395,11 @@
       break;
 
     case QAbstractSlider::SliderToMinimum:
-      topOfView();
+      top_home();
       break;
 
     case QAbstractSlider::SliderToMaximum:
-      bottomOfView();
+      bottom_end();
       break;
   }
 }
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic