milkytracker / MilkyTracker

An FT2 compatible music tracker
http://milkytracker.github.io/
Other
1.68k stars 159 forks source link

Vertical scrollbar up/down buttons don't work #253

Closed caseyjoy closed 2 years ago

caseyjoy commented 2 years ago

OS: Ubuntu 21.04 Milkytracker versions: 1.03, latest Github source build Issue: When clicking the up/down buttons on a vertical scrollbar in any widget using a vertical scrollbar, nothing happens. Horizontal scrollbar buttons, as well as other ways of scrolling vertical scrollbars work.

After taking a look at it (in ListBox.cpp, etc.), it seems that the reason this happens is vertical scrolling uses event->getMetaData for determining how much to scroll when the buttons are clicked, and horizontal scrolling doesn't.

Scrolling events like mousewheel movements seem to provide their own changes to metaData, so they're not affected by the default of 0 - scrolling with the mousewheel changed it to 3 when I checked.

Since the metaData of an Event defaults to 0 if it doesn't provide anything, it passes that along when you click the up/down buttons, meaning you scroll 0 lines. Therefore, if we provide a 1 value for it to pass in each of the functions in Scrollbar.cpp i.e. PPEvent e(eBarScrollUp, 1); it passes that when you click the button instead of 0, meaning vertical scrolling with the buttons works everywhere that looks for metaData.