+ //XtMakeResizeRequest(widget, 200, 2000, &w, &h);
+
+ w = widget->core.width;
+ h = widget->core.height;
+
+ Widget parent = XtParent(widget);
+
+ Sidebar s = (Sidebar)widget;
+ XftFont *xftFont = s->sidebar.font->fonts->font;
+ UcxList *tracks = s->sidebar.window->playlist.tracks;
+ size_t numTracks = ucx_list_size(tracks);
+
+ int fontheight = xftFont->ascent;
+ int height = s->sidebar.elmHeight;
+
+
+ int list_height = numTracks * height;
+ if((list_height > s->core.height) || (w < parent->core.width)) {
+ XtMakeResizeRequest(widget, parent->core.width, list_height + 5, &w, &h);
+ }
+
+
+ XftDrawRect(s->sidebar.d, &s->sidebar.bg, 0, 0, w, h);
+
+
+ //printf("current track: %d\n", s->sidebar.window->playlist.current_track);
+
+ int i = 0;
+ UCX_FOREACH(elm, s->sidebar.window->playlist.tracks) {
+ char *name = util_resource_name(elm->data);
+ XftColor *cg = &s->sidebar.fg;
+ if(i == s->sidebar.window->playlist.current_track) {
+ XftDrawRect(s->sidebar.d, &s->sidebar.fg, 0, i*height, s->core.width, height);
+ cg = &s->sidebar.bg;
+ }
+
+ XftDrawString8(s->sidebar.d, cg, s->sidebar.font->fonts->font, 10, i*height + xftFont->ascent, (const FcChar8*)name, strlen(name));
+
+ i++;
+ }