summaryrefslogtreecommitdiff
path: root/src/report.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-06-16 16:57:10 +0100
committerJohn Wiegley <johnw@newartisans.com>2009-06-16 16:57:10 +0100
commit298a4faef371cae8f308c0b729a1a34ea7aa927c (patch)
tree277f3125c4e03f7c80c8187c6165a66286131a9b /src/report.h
parent995c94ef178d143c2458ebf66ddb084aa782e975 (diff)
downloadledger-298a4faef371cae8f308c0b729a1a34ea7aa927c.tar.gz
ledger-298a4faef371cae8f308c0b729a1a34ea7aa927c.tar.bz2
ledger-298a4faef371cae8f308c0b729a1a34ea7aa927c.zip
Move amount colorization deeper into the core
This is necessary in order to redden negative amounts correctly under all circumstances, such as component amounts of a multi-commodity balance. Fixes 727B2DF8-A2A1-4716-9C15-547F20D5F933
Diffstat (limited to 'src/report.h')
-rw-r--r--src/report.h26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/report.h b/src/report.h
index fa9318ce..a1c93c39 100644
--- a/src/report.h
+++ b/src/report.h
@@ -333,12 +333,10 @@ public:
OPTION__(report_t, balance_format_, CTOR(report_t, balance_format_) {
on(none,
- "%(ansify_if(justify(scrub(display_total), 20, -1, true), "
- " red if color & scrub(display_total) < 0))"
+ "%(justify(scrub(display_total), 20, -1, true, color))"
" %(!options.flat ? depth_spacer : \"\")"
"%-(ansify_if(partial_account(options.flat), blue if color))\n%/"
- "%(ansify_if(justify(scrub(display_total), 20, -1, true), "
- " red if color & scrub(display_total) < 0))\n%/"
+ "%(justify(scrub(display_total), 20, -1, true, color))\n%/"
"--------------------\n");
});
@@ -668,21 +666,21 @@ public:
" bold if color & !cleared))"
" %(ansify_if(justify(truncated(account, account_width, abbrev_len), "
" account_width), blue if color))"
- " %(ansify_if(justify(scrub(display_amount), amount_width, "
- " 3 + date_width + payee_width + account_width + amount_width, true), "
- " red if color & scrub(display_amount) < 0))"
- " %(ansify_if(justify(scrub(display_total), total_width, "
+ " %(justify(scrub(display_amount), amount_width, "
+ " 3 + date_width + payee_width + account_width + amount_width, "
+ " true, color))"
+ " %(justify(scrub(display_total), total_width, "
" 4 + date_width + payee_width + account_width + amount_width "
- " + total_width, true), red if color & scrub(display_amount) < 0))\n%/"
+ " + total_width, true, color))\n%/"
"%(justify(\" \", 2 + date_width + payee_width))"
"%(ansify_if(justify(truncated(account, account_width, abbrev_len), "
" account_width), blue if color))"
- " %(ansify_if(justify(scrub(display_amount), amount_width, "
- " 3 + date_width + payee_width + account_width + amount_width, true), "
- " red if color & scrub(display_amount) < 0))"
- " %(ansify_if(justify(scrub(display_total), total_width, "
+ " %(justify(scrub(display_amount), amount_width, "
+ " 3 + date_width + payee_width + account_width + amount_width, "
+ " true, color))"
+ " %(justify(scrub(display_total), total_width, "
" 4 + date_width + payee_width + account_width + amount_width "
- " + total_width, true), red if color & scrub(display_amount) < 0))\n");
+ " + total_width, true, color))\n");
});
OPTION(report_t, related); // -r