def draw_items
y = 0
w, h = dimensions
ic = 0
@items.each { |i|
t = i['title'].strip_tags || ''
text = t + ((t.length < w) ? (' ' * (w - t.length)) : '')
if i.has_key?('item_count') && i['item_count'] == 0 &&
i['updated'] > 0
color = (ic == @active_item) ? 'h_empty' : 'empty'
elsif i.has_key?('read?') && i['read?'] == false
color = (ic == @active_item) ? 'h_unread' : 'unread'
else
color = (ic == @active_item) ? 'h_text' : 'text'
end
draw(text, 1, y += 1, color, true, false) if ic >= @offset
ic += 1
}
clearrange(@items.size + 1 - @offset, h - 2)
refresh(true)
end