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

LineBox: make side only if side elements present, fix pack #748

Merged
merged 5 commits into from Jan 16, 2024

Conversation

penguinolog
Copy link
Collaborator

@penguinolog penguinolog commented Jan 16, 2024

  • BUG: LineBox().pack was ignored nonexistent top/bottom. Switch to the backend (Pile) pack usage to get proper size
  • Semi-bug: in case of no side, empty elements was partially added (top and bottom) with fixed size == 1 (Bug urwid-2.1.0 byte-compiling with py2.7 failed due to _async_kw_event_loop.py (py3 only) #393 )
  • BUG: set_title without title was not properly checked for top widget availability and caused exception
  • For consistency add right corner with width=0 if no right corner
  • Propagate default empty size for pack if widgets are optionally FIXED No size will be handled internally

Fix #337

Checklist
  • I've ensured that similar functionality has not already been implemented
  • I've ensured that similar functionality has not earlier been proposed and declined
  • I've branched off the master or python-dual-support branch
  • I've merged fresh upstream into my branch recently
  • I've ran tox successfully in local environment
  • I've included docstrings and/or documentation and/or examples for my code (if this is a new feature)

* BUG: `LineBox().pack` was ignored nonexistent top/bottom.
  Switch to the backend (Pile) `pack` usage to get proper size
* Semi-bug: in case of no side,
  empty elements was partially added (top and bottom)
  with fixed size == 1  (Bug urwid#337)
* For consistency add right corner with width=0 if no right corner
* Propagate default empty size for `pack`
  if widgets are optionally FIXED
  No size will be handled internally
@github-actions github-actions bot added the Tests Tests label Jan 16, 2024
@coveralls
Copy link

coveralls commented Jan 16, 2024

Pull Request Test Coverage Report for Build 7543080965

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 69.853%

Totals Coverage Status
Change from base Build 7541715278: 0.03%
Covered Lines: 8341
Relevant Lines: 12020

💛 - Coveralls

pressed = False

with self.subTest("No left side elements -> no side"):
l = urwid.LineBox(wrapped, tlcorner="", lline="", blcorner="")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to remove corners when lline is empty?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean it would be a nicer interface if we didn't, like with top and bottom

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can add it to make consistent with top and bottom

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@penguinolog penguinolog merged commit 96e6d70 into urwid:master Jan 16, 2024
35 checks passed
@penguinolog penguinolog deleted the line_box branch January 16, 2024 14:49
@penguinolog penguinolog mentioned this pull request Jan 17, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gap between LineBoxes in adjacent columns
3 participants