Re: How to customize double-click behavior

John Ellis <[email protected]> Thu, 13 Apr 2006 18:22:10 -0400
Newsgroups gmane.comp.gnome.apps.gqview.devel
Message-ID <[email protected]>
cedric GEMY wrote:

> i would like to add a behavior but i don't know how to change that :
> when i'm browsing the directory i would like the double-click on a 
> picture opens it in the Gimp (faster than use the menu). Do anyone have 
> tips about that. What file to modify ? What changes have to be done ?

Double click on a file in the file list would be simple: Add a test for 
double clicks (bevent->type == GDK_2BUTTON_PRESS) into the vflist_press_cb 
and vficon_press_cb signal handlers that will call start_editor_from_file() 
with the desired editor slot and the file name from fd->path or 
vfl/vfi->click_fd->path.

As for the image view itself, a double click would need to be tested for in 
pixbuf-renderer.c and from there hooked into from layout_image.c -- but you 
would need to add a lot of code to delay the 'move to next image' single 
click function until sufficient time has passed to be certain it was not 
the first part of a double click.


In addition, I am not sure which menu you are using (main or right click), 
but the right click menu doesn't seem too slow and hacking the order of the 
right click menu should be relatively easy.

Or it may be easiest to start using the existing keyboard shortcut  < 
Control + 1 > to start the gimp...


Greetings,
John

-- 
John Ellis <[email protected]>

http://gqview.sourceforge.net <GQview> | http://hideseek.sourceforge.net
http://gqmpeg.sourceforge.net <GQmpeg> |     <Preferences Hide and Seek>



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642