From 6fc730db956c8b589d415ed01184bf6671267c8f Mon Sep 17 00:00:00 2001 From: wmorgan Date: Wed, 4 Apr 2007 16:18:14 +0000 Subject: [PATCH] starred things now are yellow and i saved one character of space by moving the starsvn diffsvn diff git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@377 5c8cc53c-5e98-4d25-b20a-d8db53a31250 --- bin/sup | 2 ++ lib/sup/modes/thread-index-mode.rb | 14 +++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/bin/sup b/bin/sup index a1ce4d6..c565a78 100644 --- a/bin/sup +++ b/bin/sup @@ -65,6 +65,8 @@ begin c.add :index_old_color, Ncurses::COLOR_WHITE, Ncurses::COLOR_BLACK c.add :index_new_color, Ncurses::COLOR_WHITE, Ncurses::COLOR_BLACK, Ncurses::A_BOLD + c.add :index_starred_color, Ncurses::COLOR_YELLOW, Ncurses::COLOR_BLACK, + Ncurses::A_BOLD c.add :labellist_old_color, Ncurses::COLOR_WHITE, Ncurses::COLOR_BLACK c.add :labellist_new_color, Ncurses::COLOR_WHITE, Ncurses::COLOR_BLACK, Ncurses::A_BOLD diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb index 7bfb9ea..a904902 100644 --- a/lib/sup/modes/thread-index-mode.rb +++ b/lib/sup/modes/thread-index-mode.rb @@ -427,12 +427,20 @@ protected dp = t.direct_participants.any? { |p| AccountManager.is_account? p } p = dp || t.participants.any? { |p| AccountManager.is_account? p } - base_color = (new ? :index_new_color : :index_old_color) + base_color = + if starred + :index_starred_color + elsif new + :index_new_color + else + :index_old_color + end + [ [:tagged_color, @tags.tagged?(t) ? ">" : " "], - [:none, sprintf("%#{@date_width}s ", date)], + [:none, sprintf("%#{@date_width}s", date)], + (starred ? [:starred_color, "*"] : [:none, " "]), [base_color, sprintf("%-#{@from_width}s", from)], - [: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 + (t.subj.empty? ? "" : " ")], -- 2.45.2