Skip to content
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

Merged
merged 20 commits into from
Apr 4, 2020
Merged

Conversation

arpruss
Copy link
Contributor

@arpruss arpruss commented Apr 4, 2020

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.

@codecov
Copy link

codecov bot commented Apr 4, 2020

Codecov Report

Merging #115 into master will decrease coverage by 0.13%.
The diff coverage is 83.40%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
pygameMenu/widgets/widget.py 86.27% <50.00%> (-1.55%) ⬇️
pygameMenu/examples/multi_input.py 84.61% <75.00%> (+1.05%) ⬆️
pygameMenu/menu.py 86.80% <81.37%> (-4.02%) ⬇️
pygameMenu/widgets/textinput.py 71.85% <86.20%> (+0.14%) ⬆️
pygameMenu/controls.py 100.00% <100.00%> (ø)
pygameMenu/textmenu.py 82.71% <100.00%> (+2.96%) ⬆️
pygameMenu/utils.py 100.00% <100.00%> (ø)
pygameMenu/widgets/button.py 100.00% <100.00%> (ø)
pygameMenu/widgets/colorinput.py 93.36% <100.00%> (+4.98%) ⬆️
pygameMenu/widgets/menubar.py 88.33% <100.00%> (ø)
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cbd9863...361704e. Read the comment docs.

@ppizarror
Copy link
Owner

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.

@ppizarror
Copy link
Owner

@anxuae , @eforgacs any impressions?

@ppizarror
Copy link
Owner

Added:

  • Example in MultiInput
  • assertion support
  • alignment support for columns
  • docs and types for each variable

Needed:

  • unittests
  • README update

@ppizarror ppizarror requested a review from anxuae April 4, 2020 03:31
@ppizarror ppizarror added this to the v2.3 milestone Apr 4, 2020
pygameMenu/menu.py Outdated Show resolved Hide resolved
pygameMenu/menu.py Outdated Show resolved Hide resolved
column_weights = tuple(1 for _ in range(columns))
s = float(sum(column_weights[:columns]))
cumulative = 0
self._column_posx = []
Copy link
Contributor

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?

Copy link
Owner

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.

@ppizarror ppizarror mentioned this pull request Apr 4, 2020
@ppizarror ppizarror merged commit 8b99be9 into ppizarror:master Apr 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants