mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-27 10:07:19 +02:00
Enhancements - Context::getWidth
- Added help function to reduce general code size.
This commit is contained in:
parent
8dfe4bd30a
commit
2da4f8ba7a
4 changed files with 39 additions and 128 deletions
|
@ -126,3 +126,20 @@ int Context::interactive ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int Context::getWidth ()
|
||||
{
|
||||
// Determine window size, and set table accordingly.
|
||||
int width = config.get ("defaultwidth", (int) 80);
|
||||
#ifdef HAVE_LIBNCURSES
|
||||
if (config.get ("curses", true))
|
||||
{
|
||||
WINDOW* w = initscr ();
|
||||
width = w->_maxx + 1;
|
||||
endwin ();
|
||||
}
|
||||
#endif
|
||||
|
||||
return width;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue