From 86438f6653535af0b3f108b3c0ccb20c6e12446b Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Wed, 1 Jan 2014 11:45:48 +1100 Subject: [PATCH] listsel: minor cleanups --- alarm/listsel.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/alarm/listsel.c b/alarm/listsel.c index d6e20f5..54d2203 100644 --- a/alarm/listsel.c +++ b/alarm/listsel.c @@ -104,9 +104,6 @@ void calc_layout_no(struct sellist *list) if (top > sel) top = sel; - retry_cols: - // did_scroll = 0; - retry_scroll: /* lay things out from 'top' */ i = top; col = 0; row = 0; while (col < cols) { @@ -126,12 +123,12 @@ void calc_layout_no(struct sellist *list) } e->need_draw = 1; } - + list->han->get_size(e, &w, &h); cols = list->width / w; if (cols == 0) cols = 1; - col_retry: +col_retry: dist = 0; i = sel; e = list->han->getitem(list->list, i); @@ -272,7 +269,6 @@ void calc_layout(struct sellist *list) if (sel < 0 || list->han->getitem(list->list, sel) == NULL) sel = 0; - retry: //printf("try with top=%d cols=%d\n", top, cols); pos = top; col=0; row=0; last= -1; @@ -356,7 +352,6 @@ void calc_layout(struct sellist *list) //printf("top=%d last=%d cols=%d\n", top, last, cols); } - void configure(GtkWidget *draw, void *event, struct sellist *list) { GtkAllocation alloc; @@ -448,7 +443,6 @@ void *listsel_new(void *list, struct list_handlers *han) return rv; } - #ifdef MAIN struct list_entry_text *entries; @@ -474,6 +468,7 @@ struct list_entry *item(void *list, int n) else return NULL; } + int size(struct list_entry *i, int *width, int*height) { PangoRectangle ink, log; -- 2.39.5