This is a multi-part message in MIME format. ------=_NextPart_000_005F_01C1765F.E2E7D760 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit As requested, here is the patch in unified format... JPB ----- Original Message ----- From: "Simon Hausmann" To: "Jean-Philippe Bouchard" Cc: Sent: Monday, November 26, 2001 4:13 AM Subject: Re: PATCH: Opera mouse gestures in Konqueror > (re-directing from konqueror/embedded list to kfm-devel, which is > the list where konqueror(desktop) development takes place :) > re-attaching also the patch, for those not subscribed to the konq-e > list ;) > > On Sat, Nov 24, 2001 at 08:34:50PM -0500, Jean-Philippe Bouchard wrote: > > Now about the patch. Ever since Opera started implementing mouse > > gestures in their browser (http://www.opera.com/windows/mouse.html) I wanted > > to have them in Konqueror. The new feature 'Right click goes back in > > history' of KDE 3 is useful but it is nothing compared to mouse gestures. > > Earlier this week, I decided to give the implementation of mouse gestures in > > Konqueror a try. I implemented back and forward mouse gestures in this patch > > Very cool! :) > > > and want feedback before going further. In particular, I'd like to know if: > > > > -the patch has a chance to be integrated into Konqueror; > > IMHO yes (many people have been asking for that feature) , OTOH > we're in a feature freeze. Let's see what others (especially Dirk) > say. > > > -the implementation makes sense (I'm new to QT/KDE and pretty green in > > C++); > > Yes, looks quite good :) > (can you re-do the patch as unified diff (with cvs diff -u ...) ? > makes the patch a bit more readable :) > > > -there should be an option to enable/disable mouse gestures in the > > settings; > > IMHO yes (a simple checkbox should probably do the trick) > > > -we should keep the 'Right click goes back in history' feature and if > > so, should it be mutually exclusive with mouse gestures; > > Hmm, I guess so. What do others think? > > > Simon > ------=_NextPart_000_005F_01C1765F.E2E7D760 Content-Type: application/octet-stream; name="konqueror_mouse_gestures.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="konqueror_mouse_gestures.patch" Index: konq_view.cc=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /home/kde/kdebase/konqueror/konq_view.cc,v=0A= retrieving revision 1.281=0A= diff -b -B -w -u -r1.281 konq_view.cc=0A= --- konq_view.cc 2001/11/13 18:01:43 1.281=0A= +++ konq_view.cc 2001/11/26 15:15:15=0A= @@ -83,6 +83,8 @@=0A= m_browserIface =3D new KonqBrowserInterface( this, "browseriface" );=0A= m_bBackRightClick =3D m_pMainWindow->isBackRightClickEnabled();=0A= =0A= + m_sMouseGestures.enabled =3D true;=0A= +=0A= switchView( viewFactory );=0A= }=0A= =0A= @@ -324,7 +326,7 @@=0A= if ( urlDropHandling.type() =3D=3D QVariant::Bool &&=0A= urlDropHandling.toBool() )=0A= m_pPart->widget()->installEventFilter( this );=0A= - if (m_bBackRightClick && m_pPart->widget()->inherits("QScrollView") )=0A= + if ((m_bBackRightClick || m_sMouseGestures.enabled) && = m_pPart->widget()->inherits("QScrollView") )=0A= {=0A= (static_cast(m_pPart->widget()))->viewport()->installEventFilter( this );=0A= }=0A= @@ -901,6 +903,52 @@=0A= if ( !m_pPart )=0A= return false;=0A= // kdDebug() << "--" << obj->className() << "--" << e->type() << "--" = << endl;=0A= +=0A= + if (m_sMouseGestures.enabled)=0A= + {=0A= + // Recording mouse position=0A= + if (e->type() =3D=3D QEvent::MouseButtonPress)=0A= + {=0A= + QMouseEvent *me =3D static_cast(e);=0A= + if (me->button() =3D=3D QMouseEvent::RightButton)=0A= + {=0A= + m_sMouseGestures.x =3D me->x();=0A= + m_sMouseGestures.y =3D me->y();=0A= + return true;=0A= + }=0A= + }=0A= + if (e->type() =3D=3D QEvent::MouseButtonRelease)=0A= + {=0A= + QMouseEvent *me =3D static_cast(e);=0A= + if (me->button() =3D=3D QMouseEvent::RightButton)=0A= + {=0A= + // The mouse has moved left or right, we need to go back or = forward=0A= + if (me->x() < m_sMouseGestures.x)=0A= + {=0A= + m_pMainWindow->slotBack();=0A= + }=0A= + else if (me->x() > m_sMouseGestures.x)=0A= + {=0A= + m_pMainWindow->slotForward();=0A= + }=0A= + // The mouse hasn't moved, we need to generate the context = menu we filtered out earlier =0A= + else=0A= + {=0A= + obj->removeEventFilter(this);=0A= + QContextMenuEvent ce(QContextMenuEvent::Mouse, me->pos(), = Qt::RightButton);=0A= + QApplication::sendEvent(obj, &ce);=0A= + obj->installEventFilter(this);=0A= + return true;=0A= + }=0A= + }=0A= + }=0A= + // We need to filter out context menu=0A= + if (e->type() =3D=3D QEvent::ContextMenu)=0A= + {=0A= + return true;=0A= + }=0A= + }=0A= +=0A= if ( e->type() =3D=3D QEvent::DragEnter && obj =3D=3D = m_pPart->widget() )=0A= {=0A= QDragEnterEvent *ev =3D static_cast( e );=0A= Index: konq_view.h=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /home/kde/kdebase/konqueror/konq_view.h,v=0A= retrieving revision 1.142=0A= diff -b -B -w -u -r1.142 konq_view.h=0A= --- konq_view.h 2001/11/05 10:59:53 1.142=0A= +++ konq_view.h 2001/11/26 15:15:27=0A= @@ -377,6 +377,12 @@=0A= KonqViewIface * m_dcopObject;=0A= KonqBrowserInterface *m_browserIface;=0A= bool m_bBackRightClick;=0A= +=0A= +private:=0A= + struct {=0A= + bool enabled;=0A= + int x, y;=0A= + } m_sMouseGestures;=0A= };=0A= =0A= #endif=0A= ------=_NextPart_000_005F_01C1765F.E2E7D760--