Excerpts from Colin Bell's message of Wed Nov 07 02:29:03 -0800 2007:
> Please take a careful look at this patch as I am just learning Ruby so
> I've probably done a few silly things.

I've applied this patch in modified form. There was a little work to be
done when the size of the widget changes (namely, if a widget suddenly
exceeds the previous size due to a change, the whole screen has to be
redrawn).

I've also renamed the hook "index-mode-size-widget", in case there are
other widgets you'll want to tweak later. :)

I've been trying it and I actually quite like this slight modification
of your hook code, which only displays the unread/total breakdown in the
case where some, but not all, messages in a thread are unread:

  unread_size = thread.map { |m, *o| m && m.has_label?(:unread) ? 1 : 0 }.sum
  size = thread.size
  
  case
    when size == 1 : ""
    when (unread_size == 0) || (unread_size == size) : "(#{size})"
    else "(#{unread_size}/#{size})"
  end

-- 
William <[EMAIL PROTECTED]>
_______________________________________________
sup-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/sup-talk

Reply via email to