Merged
Conversation
Closed
This commit implements horizontal layouts for livesplit-core. The horizontal layouts in the original LiveSplit were kind of weird in how when changing the height of the timer, instead of the font sizes adjusting, like in vertical mode, there would be a weird, really ugly gap. Therefore there was essential only one predefined aspect ratio that would look good. This time though, instead we use kind of a hybrid approach for horizontal mode. There is now a fixed height for all the horizontal layouts in component space. It's the two row height that we also use in vertical mode. By using a fixed height, there never is any gap. We then distribute the total width to the individual components based on a preferred width they choose. They don't actually get their preferred width, it only serves as a factor of how large the components should be compared to each other. So similar to vertical mode, horizontal mode now also has a varying width per component. This is another feature that we did not have before. Is something cut off? Just make the window wider and you'll give more space to the components, allowing them to show text and other content, without it being cut off as much. Closes LiveSplit#173
1de5458 to
2b36871
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Implement horizontal layouts for livesplit-core.
There's a few changes in how they work compared to the original LiveSplit. In the original LiveSplit we simply flipped the logic between the two axes. This doesn't work well in practice though, as text always flows horizontally and it is the main problem when it comes to the layout. Text can't arbitrarily be shaped, and cutting it off (or even abbreviating it) loses valuable information. Therefore the livesplit-core port pursues a different strategy, a more hybrid approach between both layout directions. Essentially the height of the window now similar to how it works in vertical mode, merely influences the resolution of the content. Increasing the height doesn't introduce any additional spacing, the content is just adjusted to fit the height chosen. Instead the width now, similar to how it works in vertical mode, decides on how wide to render the components. If text doesn't fit, it needs to be cut off. But this way now allows the user to widen the window to show more text, while the horizontal mode in the original LiveSplit always showed the same amount of text, as it always chose the same component space width, regardless of the aspect ratio or other influences.
Roadmap:
Resolves #173