All of the old styles had visibility issues, and rendering code was a bit too overcomplicated. This fixes all if it by rendering chapters as diamond indicators on top of the timeline.
`timeline_chapters` option is now a boolean, and `timeline_chapters_opacity` & `timeline_chapters_width` have been removed.
This means chapter rendering is no longer configurable, as they resize based on timeline size, and inherit its opacity and border size, so I don't see what anyone would want to configure here, but I'm sure I'll get some requests as always :'(.
ref #206
Chapters and cache used the time width calculated from the time padding,
which was a rounded value, instead of the time width that is used for
the progress indicator and the time calculation for mouse input.
This led to e.g. the chapter line for a chapter at 0s being rendered one
pixel too far to the right.
Now the time_x and time_width are the same as in the other calculations
and the chapter and cache components decide for themselves how to deal
with that.
Chapter indicators are now correctly positioned, even at the extremes.
Cache now starts and ends exactly where the center pixel for the
progress line would be. This is inclusive, so e.g. for a 3 pixel wide
progress line, time would start 1.5 pixels in, but cache starts 1 pixel
in. This is to have clean edges for the cache at the start and the end.
The padding indicator for the cache is now moved one pixel outside of
the cache range instead of overlapping with the beginning and the end,
basically making the cache go from one wall to the other.
With this, the codebase is mostly typed (as much as sumneko's type checking allows), and finally go-to-definition-able.
This refactor changed or touched more than 90% of the codebase, so here's just the most notable changes I can recall:
Menu implementation is now way more robust, and supports:
- live menu updates
- opening submenus allows navigating to parent menus
- items icons and bold & italic styling
- keeping menu open after selecting the item
- peeking submenus
- and a lot of other small tweaks
The menu input data structure changed. It no longer accepts `active_index` and `selected_index`, instead, each item can now have `active` or `selected` property.
And I'm sure there's a lot I'm forgetting to mention, but it's midnight here T.T
closes#144, ref #171, closes#176