mirror of
git://projects.qi-hardware.com/fped.git
synced 2024-11-22 20:11:53 +02:00
gui_frame.c: allow scrolling through packages also on the name template
This commit is contained in:
parent
8982d09474
commit
23a33488d4
58
gui_frame.c
58
gui_frame.c
@ -1538,6 +1538,34 @@ static void unselect_pkg_name(void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static gboolean pkg_scroll_event(GtkWidget *widget, GdkEventScroll *event,
|
||||||
|
gpointer data)
|
||||||
|
{
|
||||||
|
struct pkg *pkg, *last;
|
||||||
|
|
||||||
|
switch (event->direction) {
|
||||||
|
case GDK_SCROLL_UP:
|
||||||
|
if (active_pkg->next)
|
||||||
|
active_pkg = active_pkg->next;
|
||||||
|
else
|
||||||
|
active_pkg = pkgs->next;
|
||||||
|
change_world();
|
||||||
|
break;
|
||||||
|
case GDK_SCROLL_DOWN:
|
||||||
|
last = NULL;
|
||||||
|
for (pkg = pkgs->next; pkg && (!last || pkg != active_pkg);
|
||||||
|
pkg = pkg->next)
|
||||||
|
last = pkg;
|
||||||
|
active_pkg = last;
|
||||||
|
change_world();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
/* ignore */;
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static gboolean pkg_name_edit_event(GtkWidget *widget, GdkEventButton *event,
|
static gboolean pkg_name_edit_event(GtkWidget *widget, GdkEventButton *event,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
@ -1569,6 +1597,8 @@ static GtkWidget *build_pkg_name(void)
|
|||||||
|
|
||||||
g_signal_connect(G_OBJECT(box_of_label(label)),
|
g_signal_connect(G_OBJECT(box_of_label(label)),
|
||||||
"button_press_event", G_CALLBACK(pkg_name_edit_event), NULL);
|
"button_press_event", G_CALLBACK(pkg_name_edit_event), NULL);
|
||||||
|
g_signal_connect(G_OBJECT(box_of_label(label)),
|
||||||
|
"scroll_event", G_CALLBACK(pkg_scroll_event), NULL);
|
||||||
|
|
||||||
return box_of_label(label);
|
return box_of_label(label);
|
||||||
}
|
}
|
||||||
@ -1577,34 +1607,6 @@ static GtkWidget *build_pkg_name(void)
|
|||||||
/* ----- packages ---------------------------------------------------------- */
|
/* ----- packages ---------------------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
static gboolean pkg_scroll_event(GtkWidget *widget, GdkEventScroll *event,
|
|
||||||
gpointer data)
|
|
||||||
{
|
|
||||||
struct pkg *pkg, *last;
|
|
||||||
|
|
||||||
switch (event->direction) {
|
|
||||||
case GDK_SCROLL_UP:
|
|
||||||
if (active_pkg->next)
|
|
||||||
active_pkg = active_pkg->next;
|
|
||||||
else
|
|
||||||
active_pkg = pkgs->next;
|
|
||||||
change_world();
|
|
||||||
break;
|
|
||||||
case GDK_SCROLL_DOWN:
|
|
||||||
last = NULL;
|
|
||||||
for (pkg = pkgs->next; pkg && (!last || pkg != active_pkg);
|
|
||||||
pkg = pkg->next)
|
|
||||||
last = pkg;
|
|
||||||
active_pkg = last;
|
|
||||||
change_world();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
/* ignore */;
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static gboolean pkg_select_event(GtkWidget *widget, GdkEventButton *event,
|
static gboolean pkg_select_event(GtkWidget *widget, GdkEventButton *event,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user