Version: 3.2.2 (using KDE KDE 3.2.3) Installed from: Debian testing/unstable Packages OS: Linux Hello, This actually like 1.5 requests. I think it'd be a good idea to make the mouse wheel have dual functionality. You should make it possible to use the wheel for "Zoom" for this added functionality. You could just add a click event that does something like Action=Action XOR 1 on the wheel button. You might have a little icon in the status bar to indicate if it's zoom or scroll mode. They could be a magnifying glass and 2 vertical arrows pointing opposite directions. Thanx
SVN commit 696743 by nikolaus: UI Scrolling/Zooming. Let the canvas controller handle the wheel events. Ctrl+wheel now zooms. CCBUG: 95617 M +7 -4 Border.cpp M +1 -0 Border.h M +0 -14 Canvas.cpp M +0 -2 Canvas.h --- trunk/koffice/kspread/ui/Border.cpp #696742:696743 @@ -464,8 +464,7 @@ void VBorder::wheelEvent( QWheelEvent* _ev ) { - if ( m_pCanvas->vertScrollBar() ) - QApplication::sendEvent( m_pCanvas->vertScrollBar(), _ev ); + QApplication::sendEvent( m_pCanvas, _ev ); } @@ -1157,8 +1156,7 @@ void HBorder::wheelEvent( QWheelEvent* _ev ) { - if ( m_pCanvas->horzScrollBar() ) - QApplication::sendEvent( m_pCanvas->horzScrollBar(), _ev ); + QApplication::sendEvent( m_pCanvas, _ev ); } void HBorder::resizeEvent( QResizeEvent* _ev ) @@ -1528,4 +1526,9 @@ m_view->selectAll(); } +void SelectAllButton::wheelEvent(QWheelEvent* event) +{ + QApplication::sendEvent(m_view->canvasWidget(), event); +} + #include "Border.moc" --- trunk/koffice/kspread/ui/Border.h #696742:696743 @@ -185,6 +185,7 @@ virtual void paintEvent( QPaintEvent* event ); virtual void mousePressEvent( QMouseEvent* event ); virtual void mouseReleaseEvent( QMouseEvent* event ); + virtual void wheelEvent( QWheelEvent* ); private: View* m_view; --- trunk/koffice/kspread/ui/Canvas.cpp #696742:696743 @@ -71,7 +71,6 @@ #include <QTextStream> #include <QTimer> #include <QToolTip> -#include <QWheelEvent> #include <QWidget> // KDE @@ -783,19 +782,6 @@ setCursor( Qt::ArrowCursor ); } -void Canvas::wheelEvent( QWheelEvent* _ev ) -{ - if ( _ev->orientation() == Qt::Vertical ) - { - if ( vertScrollBar() ) - QApplication::sendEvent( vertScrollBar(), _ev ); - } - else if ( horzScrollBar() ) - { - QApplication::sendEvent( horzScrollBar(), _ev ); - } -} - void Canvas::paintEvent( QPaintEvent* event ) { if ( d->view->doc()->isLoading() || d->view->isLoading() ) --- trunk/koffice/kspread/ui/Canvas.h #696742:696743 @@ -57,7 +57,6 @@ class QPen; class QResizeEvent; class QScrollBar; -class QWheelEvent; namespace KSpread { @@ -411,7 +410,6 @@ virtual void mouseReleaseEvent( QMouseEvent* _ev ); virtual void mouseMoveEvent( QMouseEvent* _ev ); virtual void mouseDoubleClickEvent( QMouseEvent* ); - virtual void wheelEvent( QWheelEvent* ); virtual void focusInEvent( QFocusEvent* ); virtual void focusOutEvent( QFocusEvent* ); virtual void dragEnterEvent(QDragEnterEvent*);
Mark fixed cause the commit above solved the request and someone can now use trhe mouse-wheel scrolling or zoom in/out as described by Stefan above. Thanks for the feedback!