[prev in list] [next in list] [prev in thread] [next in thread]
List: kfm-devel
Subject: Re: PATCH: Opera mouse gestures in Konqueror
From: Simon Hausmann <hausmann () kde ! org>
Date: 2001-11-26 9:13:32
[Download RAW message or body]
(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
["konqueror_mouse_gestures.patch" (text/plain)]
Index: konq_view.cc
===================================================================
RCS file: /home/kde/kdebase/konqueror/konq_view.cc,v
retrieving revision 1.281
diff -b -B -w -r1.281 konq_view.cc
85a86,87
> m_sMouseGestures.enabled = true;
>
327c329
< if (m_bBackRightClick && m_pPart->widget()->inherits("QScrollView") )
---
> if ((m_bBackRightClick || m_sMouseGestures.enabled) && m_pPart->widget()->inherits("QScrollView") )
903a906,951
>
> if (m_sMouseGestures.enabled)
> {
> // Recording mouse position
> if (e->type() == QEvent::MouseButtonPress)
> {
> QMouseEvent *me = static_cast<QMouseEvent *>(e);
> if (me->button() == QMouseEvent::RightButton)
> {
> m_sMouseGestures.x = me->x();
> m_sMouseGestures.y = me->y();
> return true;
> }
> }
> if (e->type() == QEvent::MouseButtonRelease)
> {
> QMouseEvent *me = static_cast<QMouseEvent *>(e);
> if (me->button() == QMouseEvent::RightButton)
> {
> // The mouse has moved left or right, we need to go back or forward
> if (me->x() < m_sMouseGestures.x)
> {
> m_pMainWindow->slotBack();
> }
> else if (me->x() > m_sMouseGestures.x)
> {
> m_pMainWindow->slotForward();
> }
> // The mouse hasn't moved, we need to generate the context menu we filtered out earlier
> else
> {
> obj->removeEventFilter(this);
> QContextMenuEvent ce(QContextMenuEvent::Mouse, me->pos(), Qt::RightButton);
> QApplication::sendEvent(obj, &ce);
> obj->installEventFilter(this);
> return true;
> }
> }
> }
> // We need to filter out context menu
> if (e->type() == QEvent::ContextMenu)
> {
> return true;
> }
> }
>
Index: konq_view.h
===================================================================
RCS file: /home/kde/kdebase/konqueror/konq_view.h,v
retrieving revision 1.142
diff -b -B -w -r1.142 konq_view.h
379a380,385
>
> private:
> struct {
> bool enabled;
> int x, y;
> } m_sMouseGestures;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic