Repository navigation
Configurable Column Widths - #360
Conversation
|
Thanks! Sorry for a delay in getting into this. It looks good, but you should parse the config into a vector when processing configuration, not every time a screen is resized. |
|
I think I've got it working. |
| itsLeftColWidth = COLS/3-1; | ||
| itsMiddleColWidth = COLS/3; | ||
|
|
||
| std::vector<int> ratio_vector = Config.media_library_column_width_ratio_three; |
There was a problem hiding this comment.
Why do you copy the vector here? Same below.
| return true; | ||
| } | ||
|
|
||
| std::vector<int> check_ratio_two(const std::string &v) |
There was a problem hiding this comment.
Instead of all of these helpers I think you can generalize list_of to take a separator and optional length of a list, then use boost::bind to partially apply it.
|
|
||
| std::string pattern; | ||
|
|
||
| std::vector<int> playlist_editor_column_width_ratio; |
There was a problem hiding this comment.
int is inaccurate, we expect positive numbers here.
|
Thanks for the feedback.
|
|
|
|
I'm fairly certain that the default escape, separator, and quote chars are correct ( |
| { | ||
| std::vector<ValueT> result; | ||
| boost::tokenizer<boost::escaped_list_separator<char>> elems(v); | ||
| boost::escaped_list_separator<char> ecq(e, c, q); |
There was a problem hiding this comment.
Can these be more descriptive? What is e, c and q?
| std::string e(""); | ||
| std::string c(":"); | ||
| std::string q(""); | ||
| std::vector<size_t> ret = list_of<size_t>(v, verbose_lexical_cast<size_t>, length, e, c, q); |
There was a problem hiding this comment.
No need to bind e,c,q if you're not using it later.
|
Thanks! |
I have added configurable column widths for the media library and playlist editor screens.
This is done through setting a ratio in the configuration file.
The defaults are at sensible values (i.e. the current values), which are 1:1:1, 1:1, and 1:2, for media library 3 columns, media library 2 columns, and playlist editor respectively.