Make source and translation columns resizable and use an optimized initial size #249
+9
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Strings will often not fit in source and translation columns. No size would be enough to guarantee that they fit, so I've changed these columns to be resizable.
I've also made it so an optimal column size is computed when the file is opened. Computing an optimized initial column width saves users time, making it easier for them to compare strings. Ideal column sizes are ones in which all columns are visible, where source, translation, and comments have the most space, and source and translation both have the same amount of space.
I used the window width as the reference size to compute the columns because the tableView's width hasn't been set at the point of column initialization. Dividing window width by 4 takes the window's sidebar into account. It results in a varying size for the comments column that works well across multiple window sizes, with and without the presence of the sidebar.