Chatterino / chatterino2

Chat client for https://twitch.tv
MIT License
1.98k stars 444 forks source link

refactor: cleanup and document `Scrollbar` #5334

Closed Nerixyz closed 2 months ago

Nerixyz commented 3 months ago

Working on https://github.com/Chatterino/chatterino2/pull/5329, I realized that Scrollbar needed some documentation and a rename of largeChange. Then I saw some unused functions and clang-tidy warnings, so I decided to refactor the whole class.

The commits and documentation should work on their own - if you're missing information, please point that out and I'll add more docs.

Since I added some documentation, I decided to add a doxygen target (if available), so I don't have to re-add that every time I want to generate documentation. It's not meant to be pretty - we could use breathe for that. But it's not really a priority since Chatterino isn't a library.

Pizzabelly commented 3 months ago

Nice. I could suggest renaming resetMaximum() to resetBounds(). Maybe also a note about getRelativeCurrentValue() being the current position adjusted to the bounds.

pajlada commented 2 months ago

I added some tests for addHighlightsAtStart that run on current master, but fails with this PR

dnsge commented 2 months ago

I have a couple more things that would be nice to refactor, see https://github.com/Nerixyz/chatterino2/pull/22 :)