From: marcus-sup@bar-coded.net (Marcus Williams)
Subject: [sup-talk] [PATCH] Minimalist view
Date: Fri, 12 Jun 2009 21:46:32 +0100 [thread overview]
Message-ID: <1244839497-sup-547@tomsk> (raw)
Adds a keypress to toggle to a minimalist view in thread index mode.
This removes the date, authors and number of threads from the view
leaving more room for labels/snippets
---
lib/sup/modes/thread-index-mode.rb | 34 +++++++++++++++++++++++++++-------
1 files changed, 27 insertions(+), 7 deletions(-)
diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb
index 0bd8110..5fa4f4c 100644
--- a/lib/sup/modes/thread-index-mode.rb
+++ b/lib/sup/modes/thread-index-mode.rb
@@ -45,6 +45,7 @@ EOS
k.add :apply_to_tagged, "Apply next command to all tagged threads", '+', '='
k.add :join_threads, "Force tagged threads to be joined into the same thread", '#'
k.add :undo, "Undo the previous action", 'u'
+ k.add :toggle_minimalist, "Toggle minimalist view", '~'
end
def initialize hidden_labels=[], load_thread_opts={}
@@ -62,6 +63,8 @@ EOS
@hidden_labels = hidden_labels + LabelManager::HIDDEN_RESERVED_LABELS
@date_width = DATE_WIDTH
+ @minimal = false
+
@interrupt_search = false
initialize_threads # defines @ts and @ts_mutex
@@ -261,6 +264,11 @@ EOS
end
end
+ def toggle_minimalist
+ @minimal = !@minimal
+ regen_text
+ end
+
def toggle_starred
t = cursor_thread or return
undo = actually_toggle_starred t
@@ -833,13 +841,25 @@ protected
size_widget_text = sprintf "%#{ @size_widget_width}s", size_widget
- [
- [:tagged_color, @tags.tagged?(t) ? ">" : " "],
- [:none, sprintf("%#{@date_width}s", date)],
- (starred ? [:starred_color, "*"] : [:none, " "]),
- ] +
- from +
- [
+
+ if @minimal
+ if size_widget!=""
+ size_widget_text = "+"
+ else
+ size_widget_text = " "
+ end
+ line = []
+ else
+ line = [
+ [:tagged_color, @tags.tagged?(t) ? ">" : " "],
+ [:none, sprintf("%#{@date_width}s", date)],
+ (starred ? [:starred_color, "*"] : [:none, " "]),
+ ] + from
+ end
+
+
+ line +
+ [
[subj_color, size_widget_text],
[:to_me_color, t.labels.member?(:attachment) ? "@" : " "],
[:to_me_color, dp ? ">" : (p ? '+' : " ")],
--
1.5.4.1
next reply other threads:[~2009-06-12 20:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-12 20:46 Marcus Williams [this message]
2009-06-14 1:36 ` Ben Walton
2009-06-14 13:17 ` Marcus Williams
2009-06-15 13:50 ` William Morgan
2009-06-15 13:54 ` Ben Walton
2009-06-16 12:45 ` Marcus Williams
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1244839497-sup-547@tomsk \
--to=marcus-sup@bar-coded.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox