finch/plugins/lastlog.c

branch
release-2.x.y
changeset 39650
5e35b90de7b3
parent 39647
50ac98a0ecb1
equal deleted inserted replaced
39649:951399f32018 39650:5e35b90de7b3
40 static gboolean 40 static gboolean
41 window_kpress_cb(GntWidget *wid, const char *key, GntTextView *view) 41 window_kpress_cb(GntWidget *wid, const char *key, GntTextView *view)
42 { 42 {
43 if (key[0] == 27) 43 if (key[0] == 27)
44 { 44 {
45 if (purple_strequal(key, GNT_KEY_DOWN)) 45 if (purple_strequal(key, GNT_KEY_DOWN)) {
46 gnt_text_view_scroll(view, 1); 46 gnt_text_view_scroll(view, 1);
47 else if (purple_strequal(key, GNT_KEY_UP)) 47 } else if (purple_strequal(key, GNT_KEY_UP)) {
48 gnt_text_view_scroll(view, -1); 48 gnt_text_view_scroll(view, -1);
49 else if (purple_strequal(key, GNT_KEY_PGDOWN)) 49 } else if (purple_strequal(key, GNT_KEY_PGDOWN)) {
50 gnt_text_view_scroll(view, wid->priv.height - 2); 50 int height = 0;
51 else if (purple_strequal(key, GNT_KEY_PGUP)) 51 gnt_widget_get_size(wid, NULL, &height);
52 gnt_text_view_scroll(view, -(wid->priv.height - 2)); 52 gnt_text_view_scroll(view, height - 2);
53 else 53 } else if (purple_strequal(key, GNT_KEY_PGUP)) {
54 int height = 0;
55 gnt_widget_get_size(wid, NULL, &height);
56 gnt_text_view_scroll(view, -(height - 2));
57 } else {
54 return FALSE; 58 return FALSE;
59 }
55 return TRUE; 60 return TRUE;
56 } 61 }
57 return FALSE; 62 return FALSE;
58 } 63 }
59 64

mercurial