Date:2012-08-21 07:13:55 (7 years 3 months ago)
Author:Werner Almesberger
Commit:23a33488d44188179d04498fb2e5386e81a70a71
Message:gui_frame.c: allow scrolling through packages also on the name template

Files: gui_frame.c (3 diffs)

Change Details

gui_frame.c
15381538}
15391539
15401540
1541static gboolean pkg_scroll_event(GtkWidget *widget, GdkEventScroll *event,
1542    gpointer data)
1543{
1544    struct pkg *pkg, *last;
1545
1546    switch (event->direction) {
1547    case GDK_SCROLL_UP:
1548        if (active_pkg->next)
1549            active_pkg = active_pkg->next;
1550        else
1551            active_pkg = pkgs->next;
1552        change_world();
1553        break;
1554    case GDK_SCROLL_DOWN:
1555        last = NULL;
1556        for (pkg = pkgs->next; pkg && (!last || pkg != active_pkg);
1557            pkg = pkg->next)
1558            last = pkg;
1559        active_pkg = last;
1560        change_world();
1561        break;
1562    default:
1563        /* ignore */;
1564    }
1565    return TRUE;
1566}
1567
1568
15411569static gboolean pkg_name_edit_event(GtkWidget *widget, GdkEventButton *event,
15421570    gpointer data)
15431571{
...... 
15691597
15701598    g_signal_connect(G_OBJECT(box_of_label(label)),
15711599        "button_press_event", G_CALLBACK(pkg_name_edit_event), NULL);
1600    g_signal_connect(G_OBJECT(box_of_label(label)),
1601        "scroll_event", G_CALLBACK(pkg_scroll_event), NULL);
15721602
15731603    return box_of_label(label);
15741604}
...... 
15771607/* ----- packages ---------------------------------------------------------- */
15781608
15791609
1580static gboolean pkg_scroll_event(GtkWidget *widget, GdkEventScroll *event,
1581    gpointer data)
1582{
1583    struct pkg *pkg, *last;
1584
1585    switch (event->direction) {
1586    case GDK_SCROLL_UP:
1587        if (active_pkg->next)
1588            active_pkg = active_pkg->next;
1589        else
1590            active_pkg = pkgs->next;
1591        change_world();
1592        break;
1593    case GDK_SCROLL_DOWN:
1594        last = NULL;
1595        for (pkg = pkgs->next; pkg && (!last || pkg != active_pkg);
1596            pkg = pkg->next)
1597            last = pkg;
1598        active_pkg = last;
1599        change_world();
1600        break;
1601    default:
1602        /* ignore */;
1603    }
1604    return TRUE;
1605}
1606
1607
16081610static gboolean pkg_select_event(GtkWidget *widget, GdkEventButton *event,
16091611    gpointer data)
16101612{

Archive Download the corresponding diff file

Branches:
master



interactive