View Single Post
Old 07-01-2009, 05:58 PM   #93
ericshliao
Guru
ericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enough
 
Posts: 976
Karma: 687
Join Date: Nov 2007
Device: Dell X51v; iLiad v2
This is a fully working newLister with clickable titlebar.
Clicking on the left half of titlebar will go back to top-menu, and clicking on the right half will go up one level.
The attachment is the binary file. Install as I described in the previous post.

Because the code is too simple, diff file is not needed. I just put my code here:

in "lister.c", add a line:
Code:
g_signal_connect(G_OBJECT(titleBackground), "button_press_event",
    G_CALLBACK(ls_titlebar_press_event), NULL);
just before (or after) the line:
Code:
g_signal_connect(G_OBJECT(titleBackground), "expose-event", G_CALLBACK(ls_lister_expose_event), NULL);
And add the function call:
Code:
gboolean ls_titlebar_press_event(GtkWidget * widget, GdkEventButton * event, gpointer data)
{
	int x = (int) ((GdkEvent*)event)->button.x_root;
	if(x>=768/2){
		CL_LOGPRINTF("OVERVIEW_BUTTON LONG");
		pm_SendKey(GDK_Home);
	}else{
		CL_LOGPRINTF("OVERVIEW_BUTTON");
        	pm_SendKey(GDK_F5);
	}
	return FALSE;
}
Note:
When you click on the title bar, LED won't flash. To make LED falsh just as we push MODE button and OVERVIEW button, some more code is needed.
Attached Files
File Type: zip newLister.mod.zip (94.9 KB, 561 views)

Last edited by ericshliao; 07-01-2009 at 06:02 PM.
ericshliao is offline   Reply With Quote