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

Dynamically adjust the column widths #926

Merged
merged 1 commit into from
Jun 9, 2024

Conversation

CryZe
Copy link
Collaborator

@CryZe CryZe commented Jun 9, 2024

Instead of assuming each column has the width of the text 88:88:88, we now determine the largest string per column (based on unicode scalar values) and adjust the column width accordingly. There is still a fixed minimum width based on the string 88:88, which ensures that the columns don't switch sizes too often, especially if you start with empty splits. We could've also chosen 8:88:88, which would ensure there's no column size change as you approach the hour mark. However, this would increase the size of delta columns unnecessarily. So it's a little bit of a trade-off.

@CryZe CryZe added enhancement A new feature or general improvement to LiveSplit One. layout rendering This affects the rendering of LiveSplit layouts. labels Jun 9, 2024
@CryZe CryZe force-pushed the dynamic-column-sizes branch from 7e705c6 to 3a6cb05 Compare June 9, 2024 15:57
@CryZe CryZe changed the title Dynamic column sizes @CryZe Dynamically adjust the column widths Jun 9, 2024
@CryZe CryZe changed the title @CryZe Dynamically adjust the column widths Dynamically adjust the column widths Jun 9, 2024
@CryZe CryZe linked an issue Jun 9, 2024 that may be closed by this pull request
Instead of assuming each column has the width of the text `88:88:88`, we
now determine the largest string per column (based on unicode scalar
values) and adjust the column width accordingly. There is still a fixed
minimum width based on the string `88:88`, which ensures that the
columns don't switch sizes too often, especially if you start with empty
splits. We could've also chosen `8:88:88`, which would ensure there's no
column size change as you approach the hour mark. However, this would
increase the size of delta columns unnecessarily. So it's a little bit
of a trade-off.
@CryZe CryZe force-pushed the dynamic-column-sizes branch from 3a6cb05 to ea760d3 Compare June 9, 2024 16:02
@CryZe CryZe merged commit ba45f17 into LiveSplit:master Jun 9, 2024
1 check passed
@CryZe CryZe deleted the dynamic-column-sizes branch June 9, 2024 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A new feature or general improvement to LiveSplit One. layout rendering This affects the rendering of LiveSplit layouts.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adjust column widths, taking column time formatters into account
1 participant