traverso-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Traverso-devel] Re: [Traverso-commit] traverso/src/traverso Interfa


From: Remon
Subject: Re: [Traverso-devel] Re: [Traverso-commit] traverso/src/traverso Interface.cpp Interface.h
Date: Sat, 8 Dec 2007 16:27:14 +0100
User-agent: KMail/1.9.6 (enterprise 0.20070907.709405)

Hi,

Thanks for catching this one, though it was the other commit to Interface that 
introduced the problem. Fixed now !

Remon


> This isn't working quite right since the coordinates while dragging
> over the context menu need to be translated into the coordinates of
> the selected item or the viewport or something.  To see what I mean,
> try dragging a node, and while dragging it, press <Q>, and then keep
> dragging over the menu.
>
> Ben
>
> On Dec 6, 2007 12:51 PM, Remon Sijrier <address@hidden> wrote:
> > CVSROOT:        /sources/traverso
> > Module name:    traverso
> > Changes by:     Remon Sijrier <r_sijrier>       07/12/06 20:51:59
> >
> > Modified files:
> >         src/traverso   : Interface.cpp Interface.h
> >
> > Log message:
> >         * use an event filter to catch key release events on context
> > menus, and forward them to the InputEngine
> >
> > CVSWeb URLs:
> > http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/Interface.cpp?c
> >vsroot=traverso&r1=1.116&r2=1.117
> > http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/Interface.h?cvs
> >root=traverso&r1=1.49&r2=1.50
> >
> > Patches:
> > Index: Interface.cpp
> > ===================================================================
> > RCS file: /sources/traverso/traverso/src/traverso/Interface.cpp,v
> > retrieving revision 1.116
> > retrieving revision 1.117
> > diff -u -b -r1.116 -r1.117
> > --- Interface.cpp       5 Dec 2007 21:20:05 -0000       1.116
> > +++ Interface.cpp       6 Dec 2007 20:51:59 -0000       1.117
> > @@ -361,6 +361,28 @@
> >         e->ignore();
> >  }
> >
> > +bool Interface::eventFilter(QObject * obj, QEvent * event)
> > +{
> > +       QMenu* menu = qobject_cast<QMenu*>(obj);
> > +
> > +       // If the installed filter was for a QMenu, we need to
> > +       // delegate key releases to the InputEngine, e.g. a hold
> > +       // action would never finish if we release the hold key
> > +       // on the open Menu, resulting in weird behavior!
> > +       if (menu) {
> > +               if (event->type() == QEvent::KeyRelease) {
> > +                       QKeyEvent *keyEvent =
> > static_cast<QKeyEvent*>(event); +                      
> > ie().catch_key_release(keyEvent);
> > +                       return true;
> > +               } else {
> > +                       return false;
> > +               }
> > +       }
> > +
> > +       return false;
> > +}
> > +
> > +
> >  void Interface::changeEvent(QEvent *event)
> >  {
> >         switch (event->type()) {
> > @@ -783,8 +805,6 @@
> >
> >  QMenu* Interface::create_context_menu(QObject* item, QList<MenuData >*
> > menulist) {
> > -       QMenu* menu = new QMenu(this);
> > -
> >         QList<MenuData > list;
> >         if (item) {
> >                  list = ie().create_menudata_for( item );
> > @@ -797,7 +817,6 @@
> >                 return 0;
> >         }
> >
> > -
> >         qSort(list.begin(), list.end(), MenuData::smaller);
> >
> >
> > @@ -810,6 +829,9 @@
> >
> >         if (name == "Song") name = "Sheet"; // FIXME!!!
> >
> > +       QMenu* menu = new QMenu(this);
> > +       menu->installEventFilter(this);
> > +
> >         QAction* menuAction = menu->addAction(name);
> >         QFont font(themer()->get_font("ContextMenu:fontscale:actions"));
> >         font.setBold(true);
> >
> > Index: Interface.h
> > ===================================================================
> > RCS file: /sources/traverso/traverso/src/traverso/Interface.h,v
> > retrieving revision 1.49
> > retrieving revision 1.50
> > diff -u -b -r1.49 -r1.50
> > --- Interface.h 5 Dec 2007 21:20:05 -0000       1.49
> > +++ Interface.h 6 Dec 2007 20:51:59 -0000       1.50
> > @@ -94,6 +94,7 @@
> >         void closeEvent ( QCloseEvent * event );
> >         QSize sizeHint () const;
> >         void changeEvent(QEvent *event);
> > +       bool eventFilter(QObject *obj, QEvent *ev);
> >
> >  private:
> >         QStackedWidget*         centerAreaWidget;
> >
> >
> > _______________________________________________
> > Traverso-commit mailing list
> > address@hidden
> > http://lists.nongnu.org/mailman/listinfo/traverso-commit
>
> _______________________________________________
> Traverso-devel mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/traverso-devel






reply via email to

[Prev in Thread] Current Thread [Next in Thread]