Ticket #2110 (closed patch (an actual patch, not a request for one): fixed)
Mousewheel menu patch
| Reported by: | noccy | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.3.x |
| Component: | other | Version: | unspecified |
| Keywords: | mousewheel patch | Cc: | |
| Blocked By: | Blocking: | ||
| Operating System: | All/Non-Specific |
Description
This patch enables mousewheel scrolling over the construction, research and build menus. The code has been optimized and all the previous display glitches have been sorted.
The directions of the scrolling (currently down goes to the next page and up the previous) can easily be swapped, and with the pageswapping functions implemented as kf_-functions, adding keyboard shortcuts for them would be an easy task :)
Attachments
Change History
Changed 18 months ago by noccy
- Attachment wz-2.3-new-scrollpatch-proper.diff added
Scrollwheel menu patch
comment:2 Changed 18 months ago by Zarel
ENDORSE WHOLEHEARTEDLY.
(Disclaimer: Not an actual endorsement; I haven't actually tested this patch yet nor reviewed it.)
comment:4 follow-up: ↓ 5 Changed 18 months ago by Zarel
KukY: Apply to 2.3-branch, merge into trunk.
comment:5 in reply to: ↑ 4 Changed 18 months ago by KukY
Replying to Zarel:
KukY: Apply to 2.3-branch, merge into trunk.
Even if I knew how to do that, I don't have 2.3 source on my PC.
comment:6 Changed 18 months ago by Zarel
You don't know how to get 2.3 source on your PC? o_O It's the same way you get trunk; just replace "/trunk/" with "/branches/2.3/"
As for merging: http://google.com/search?q=svn+merge
comment:7 Changed 18 months ago by KukY
I know how to get 2.3 source on my PC, but I wouldn't like to spend an additional hour getting it from SVN.
comment:8 follow-up: ↓ 9 Changed 18 months ago by noccy
You can apply it to the 2.3.4 tarball, should be a quicker download :) I have an older version for trunk, but it doesn't contain all the bugfixes that are in the 2.3 patch, so I can't really recommend it for testing.
comment:9 in reply to: ↑ 8 ; follow-up: ↓ 10 Changed 18 months ago by KukY
Replying to noccy:
You can apply it to the 2.3.4 tarball, should be a quicker download :) I have an older version for trunk, but it doesn't contain all the bugfixes that are in the 2.3 patch, so I can't really recommend it for testing.
I'm on Windows, so I can't compile the tarball. Could you by any way make a patch for trunk?
comment:10 in reply to: ↑ 9 ; follow-up: ↓ 11 Changed 18 months ago by Zarel
Replying to KukY:
I'm on Windows, so I can't compile the tarball. Could you by any way make a patch for trunk?
...um, a tarball is effectively identical to an SVN checkout. If you can compile an SVN checkout, you can extract a tarball and compile that. :|
comment:11 in reply to: ↑ 10 Changed 18 months ago by KukY
Replying to Zarel:
...um, a tarball is effectively identical to an SVN checkout. If you can compile an SVN checkout, you can extract a tarball and compile that. :|
Last time I checked, the tarball doesn't include MSVC files.
comment:12 Changed 18 months ago by KukY
Very well, I got 2.3 source to my PC, but i still can't apply the patch!
comment:13 Changed 18 months ago by noccy
go to the root of the extracted tarball (the folder that has src in it) and type:
patch -p0 < wz-2.3-new-scrollpatch-proper.diff
comment:14 follow-up: ↓ 15 Changed 18 months ago by KukY
I don't have the tarball, I have the source from SVN.
And did I mention I'm on Windows? That looks pretty Linux-ish to me...
comment:15 in reply to: ↑ 14 Changed 18 months ago by noccy
Replying to KukY:
I don't have the tarball, I have the source from SVN.
Then cd into it and do the command.
And did I mention I'm on Windows? That looks pretty Linux-ish to me...
Yeah, the patch command is available in msys / mingw so make sure that it's available on your systems search path.
comment:16 follow-up: ↓ 17 Changed 18 months ago by KukY
I'm using MSVC, not MinGW.
comment:17 in reply to: ↑ 16 Changed 18 months ago by noccy
Replying to KukY:
I'm using MSVC, not MinGW.
Then you are going to have to find a compatible patch tool :p Perhaps something at this page. Can't really help you any more than that.
comment:18 Changed 18 months ago by KukY
I have software to apply the patches. But it says that lines from the patch don't match the lines in the file.
comment:19 Changed 18 months ago by noccy
They do except for fuzzy matches as the code is changing. Gnu patch tells me it matched it a few lines above where it was found. But just increase the fuzzyness i.e. how many lines around the target line are searched for the matching text.
noccy@noccy-laptop:~/Development/src/warzone2100-2.3-svn$ patch -p0 < wz-2.3-new-scrollpatch-proper.diff patching file src/display.c patching file src/keybind.c Hunk #1 succeeded at 2819 (offset -173 lines). patching file src/keybind.h Hunk #1 succeeded at 247 (offset -1 lines). patching file src/hci.c Hunk #1 succeeded at 7279 (offset -10 lines). patching file src/hci.h Hunk #1 succeeded at 455 (offset -3 lines). patching file lib/widget/form.c noccy@noccy-laptop:~/Development/src/warzone2100-2.3-svn$ }}}}
comment:20 Changed 18 months ago by KukY
I applied the patch manually. I'll test the feature now.
comment:21 Changed 18 months ago by KukY
Yay, it works! And I like it.
I'll attach a patch for current code.
Changed 18 months ago by KukY
- Attachment scrollMenu-2.3.patch added
The patch updated for current code.
comment:23 Changed 16 months ago by buginator <buginator@…>
- Status changed from new to closed
- Resolution set to fixed
(In [e979b6ad620f27e746f119fefd1f613bbb61b8a4]) Commit patch from ticket:2110 "Mousewheel menu patch" Author: noccy Thanks for the patch!
Format and additional changes by me.
Close ticket:2110
comment:22 Changed 16 months ago by buginator <buginator@…>
comment:25 Changed 16 months ago by buginator <buginator@…>
(In [d0217d5d4e49c048b522bbc503395b9828cfd7e6]) Commit patch from ticket:2110 "Mousewheel menu patch" Author: noccy Thanks for the patch!
Format and additional changes by me.
Close ticket:2110 (cherry picked from commit e979b6ad620f27e746f119fefd1f613bbb61b8a4)
Conflicts:
src/keybind.c src/keybind.h
comment:23 Changed 16 months ago by buginator <buginator@…>
comment:24 Changed 16 months ago by buginator <buginator@…>
comment:27 Changed 14 months ago by buginator
Commit patch from ticket:2110 "Mousewheel menu patch" Author: noccy Thanks for the patch!
Format and additional changes by me.
Close ticket:2110 (cherry picked from commit e979b6ad620f27e746f119fefd1f613bbb61b8a4)
Conflicts:
src/keybind.c src/keybind.h
Changeset: d0217d5d4e49c048b522bbc503395b9828cfd7e6
comment:28 Changed 7 months ago by buginator
Mouse wheel scrolling in research and build menus.
Cherry-picked from the 3.0 branch, plus compilation fix.
Commit patch from ticket:2110 "Mousewheel menu patch" Author: noccy Thanks for the patch!
Format and additional changes by me.
Close ticket:2110 (cherry picked from commit e979b6ad620f27e746f119fefd1f613bbb61b8a4)
Fix missing declaration from e979b6ad620f27e746f119fefd1f613bbb61b8a4 (cherry picked from commit 55cf2a4f85dac4570aca592e165a4041c8cd0940)

The patch also fixes a tab rendering issue where more tabs would be drawn than needed. I noticed this as the last page were rendered with 7 tabs when only 1 were needed. So, bug fixed! :)