-
-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multicolumn; joystick hat key repeat; better mouse handling; resize #115
Conversation
Codecov Report
@@ Coverage Diff @@
## master #115 +/- ##
==========================================
- Coverage 83.71% 83.57% -0.14%
==========================================
Files 25 25
Lines 2831 2941 +110
==========================================
+ Hits 2370 2458 +88
- Misses 461 483 +22
Continue to review full report at Codecov.
|
Nice, it works pretty well and tests passed. I'll push some changes to beautify the code, refactor quite a bit and add some examples. |
Added:
Needed:
|
column_weights = tuple(1 for _ in range(columns)) | ||
s = float(sum(column_weights[:columns])) | ||
cumulative = 0 | ||
self._column_posx = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strange to have attributes self._column_posx
and self._column_widths
defined only if several columns exist.
Shouldn't the case of a column be threatened like several columns?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've refactored the menu, now by default the number of rows is 1e6 and there's only 1 column.
I'm sorry for smooshing so much stuff into one PR, but that's the best I can do.
This include multicolumn support (just add rows=r and columns=c to the Menu() constructor), joystick hat key repeat, better mouse handling (highlight on down) and optional text width resize.