From 320609c08675d823e214c8dfed5296d292ac72b4 Mon Sep 17 00:00:00 2001 From: wmorgan Date: Wed, 20 Dec 2006 19:46:13 +0000 Subject: [PATCH] small gui improvements, mostly involving snippets git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@89 5c8cc53c-5e98-4d25-b20a-d8db53a31250 --- lib/sup/message.rb | 7 ++----- lib/sup/modes/thread-index-mode.rb | 6 +++--- lib/sup/modes/thread-view-mode.rb | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/sup/message.rb b/lib/sup/message.rb index 0f7d6b7..9ced957 100644 --- a/lib/sup/message.rb +++ b/lib/sup/message.rb @@ -297,13 +297,10 @@ private if state == :text && (@snippet.nil? || @snippet.length < SNIPPET_LEN) && line !~ /[=\*#_-]{3,}/ && line !~ /^\s*$/ - @snippet = (@snippet ? @snippet + " " : "") + line.gsub(/^\s+/, "").gsub(/[\r\n]/, "").gsub(/\s+/, " ") + @snippet += " " unless @snippet.empty? + @snippet += line.gsub(/^\s+/, "").gsub(/[\r\n]/, "").gsub(/\s+/, " ") @snippet = @snippet[0 ... SNIPPET_LEN] end -# if @snippet.nil? && state == :text && (line.length > 40 || -# line =~ /\S+.*[^,!:]\s*$/) -# @snippet = line.gsub(/^\s+/, "").gsub(/[\r\n]/, "")[0 .. 80] -# end end ## final object diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb index 5845ea2..4901a26 100644 --- a/lib/sup/modes/thread-index-mode.rb +++ b/lib/sup/modes/thread-index-mode.rb @@ -360,10 +360,10 @@ protected [:starred_color, starred ? "*" : " "], [:none, t.size == 1 ? " " * (@size_width + 2) : sprintf("(%#{@size_width}d)", t.size)], [:to_me_color, dp ? " >" : (p ? ' -' : " ")], - [base_color, t.subj] + [base_color, t.subj + (t.subj.empty? ? "" : " ")], ] + - (t.labels - @hidden_labels).map { |label| [:label_color, " +#{label}"] } + - [[:snippet_color, " " + t.snippet] + (t.labels - @hidden_labels).map { |label| [:label_color, "+#{label} "] } + + [[:snippet_color, t.snippet] ] end diff --git a/lib/sup/modes/thread-view-mode.rb b/lib/sup/modes/thread-view-mode.rb index 7a37899..ca55d1f 100644 --- a/lib/sup/modes/thread-view-mode.rb +++ b/lib/sup/modes/thread-view-mode.rb @@ -281,7 +281,7 @@ private when :open [[prefix_widget, widget, imp_widget, [:message_patina_color, - "#{m.from ? m.from.mediumname : '?'} to #{m.to.map { |l| l.shortname }.join(', ')} #{m.date.to_nice_s} (#{m.date.to_nice_distance_s})"]]] + "#{m.from ? m.from.mediumname : '?'} to #{m.recipients.map { |l| l.shortname }.join(', ')} #{m.date.to_nice_s} (#{m.date.to_nice_distance_s})"]]] # (m.to.empty? ? [] : [[[:message_patina_color, prefix + " To: " + m.recipients.map { |x| x.mediumname }.join(", ")]]]) + when :closed [[prefix_widget, widget, imp_widget, -- 2.45.2