From 6c0561cb4de06eb461718fa55b26296bb530f795 Mon Sep 17 00:00:00 2001 From: Scott Kostyshak Date: Tue, 26 Mar 2013 19:17:42 -0400 Subject: [PATCH] Bug #1210 - Fixed bug #1210 so that widths are taken from localized strings instead of hardcoded. --- ChangeLog | 2 ++ src/columns/ColStatus.cpp | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4a3e16abd..88900dd37 100644 --- a/ChangeLog +++ b/ChangeLog @@ -99,6 +99,8 @@ Bugs for the user's home directory (thanks to Jakub Wilk). + Fixed bug #1209, spelling mistake in reference page (thanks to Friedrich Heusler). + + Fixed bug #1210 so that widths are taken from localized strings instead of + hardcoded. + Improved hyphenation by splitting on commas (even if no whitespace after). Leads to better output of, for example, 'task show', where comma-separated lists are common. diff --git a/src/columns/ColStatus.cpp b/src/columns/ColStatus.cpp index 7e609e35e..d49e0c5db 100644 --- a/src/columns/ColStatus.cpp +++ b/src/columns/ColStatus.cpp @@ -31,6 +31,7 @@ #include #include #include +#include extern Context context; @@ -80,17 +81,16 @@ void ColumnStatus::measure (Task& task, unsigned int& minimum, unsigned int& max if (_style == "default" || _style == "long") { - if (status == Task::pending || - status == Task::deleted || - status == Task::waiting) - { - minimum = maximum = 7; - } - else if (status == Task::completed || - status == Task::recurring) - { - minimum = maximum = 9; - } + if (status == Task::pending) + minimum = maximum = utf8_width (STRING_COLUMN_LABEL_STAT_PE); + else if (status == Task::deleted) + minimum = maximum = utf8_width (STRING_COLUMN_LABEL_STAT_DE); + else if (status == Task::waiting) + minimum = maximum = utf8_width (STRING_COLUMN_LABEL_STAT_WA); + else if (status == Task::completed) + minimum = maximum = utf8_width (STRING_COLUMN_LABEL_STAT_CO); + else if (status == Task::recurring) + minimum = maximum = utf8_width (STRING_COLUMN_LABEL_STAT_RE); } else if (_style == "short") minimum = maximum = 1;