mirror of
https://github.com/GothenburgBitFactory/taskshell.git
synced 2025-06-26 10:54:29 +02:00
Review: Usability
- Added text banner when the review process begins. - Changed the color scheme.
This commit is contained in:
parent
0cf6c0eae9
commit
3b18b20d17
1 changed files with 35 additions and 17 deletions
|
@ -120,9 +120,23 @@ static const std::string reviewStart (
|
||||||
unsigned int total,
|
unsigned int total,
|
||||||
unsigned int width)
|
unsigned int width)
|
||||||
{
|
{
|
||||||
return "\none\n"
|
std::string welcome =
|
||||||
"two\n"
|
"The review process is important for keeping your list accurate, so you are "
|
||||||
"three\n\n";
|
"working on the right thing.\n\n"
|
||||||
|
|
||||||
|
"For each task you are shown, look at the metadata. Determine whether the "
|
||||||
|
"task needs to be changed (enter 'e' to edit), or whether it is accurate "
|
||||||
|
"(enter 'r' to mark as reviewed). You may skip a task ('enter') but a "
|
||||||
|
"skipped task is not considered reviewed.\n\n"
|
||||||
|
|
||||||
|
"You may stop at any time, and resume later, right where you left off. "
|
||||||
|
"See 'man tasksh' for more details.";
|
||||||
|
|
||||||
|
std::vector <std::string> lines;
|
||||||
|
wrapText (lines, welcome, width, false);
|
||||||
|
join (welcome, "\n", lines);
|
||||||
|
|
||||||
|
return "\n" + welcome + "\n\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -132,28 +146,32 @@ static const std::string banner (
|
||||||
unsigned int width,
|
unsigned int width,
|
||||||
const std::string& message)
|
const std::string& message)
|
||||||
{
|
{
|
||||||
std::stringstream out;
|
std::stringstream progress;
|
||||||
out << " ["
|
progress << " ["
|
||||||
<< current
|
<< current
|
||||||
<< " of "
|
<< " of "
|
||||||
<< total
|
<< total
|
||||||
<< "] "
|
<< "] ";
|
||||||
<< message;
|
|
||||||
|
|
||||||
std::string composed = out.str ();
|
Color progressColor ("color15 on color9");
|
||||||
if (composed.length () < width)
|
Color descColor ("color15 on gray6");
|
||||||
composed += std::string (width - composed.length () - 1, ' ');
|
|
||||||
|
std::string composed;
|
||||||
|
if (progress.str ().length () + message.length () + 1 < width)
|
||||||
|
composed = progressColor.colorize (progress.str ()) +
|
||||||
|
descColor.colorize (" " + message +
|
||||||
|
std::string (width - progress.str ().length () - message.length () - 1, ' '));
|
||||||
else
|
else
|
||||||
composed = composed.substr (0, width - 3) + "...";
|
composed = progressColor.colorize (progress.str ()) +
|
||||||
|
descColor.colorize (" " + message.substr (0, message.length () - 3) + "...");
|
||||||
|
|
||||||
Color color ("white on blue");
|
return composed + "\n";
|
||||||
return color.colorize (composed) + "\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
static const std::string menu ()
|
static const std::string menu ()
|
||||||
{
|
{
|
||||||
Color text ("white on blue");
|
Color text ("color15 on gray6");
|
||||||
return text.colorize (" (Enter) Skip, (e)dit, (c)ompleted, (d)eleted, Mark as (r)eviewed, (q)uit ");
|
return text.colorize (" (Enter) Skip, (e)dit, (c)ompleted, (d)eleted, Mark as (r)eviewed, (q)uit ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue