Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make source and translation columns resizable and use an optimized initial size #249

Merged
merged 2 commits into from
Mar 21, 2025

Conversation

Cuperino
Copy link
Member

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.

@Cuperino Cuperino added the ⬆️ feature New feature or request label Mar 19, 2025
@Cuperino Cuperino requested a review from narnaud March 19, 2025 22:28
@Cuperino Cuperino self-assigned this Mar 19, 2025
200 pixels are not enough to guarantee strings can fit.
No size is, therefore the user must be able to resize these columns.
Make better use of available width when dealing with Ts translation
files by setting an initial size based on the space available when the
file is opened.

I used the window width as the reference size because the tableView's
width hasn't yet been set at this point in initialization. By
dividing available space by 4, we ensure a reasonable amount of space
is available for the removable sidebar.
@Cuperino Cuperino merged commit f403343 into KDAB:main Mar 21, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⬆️ feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants