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

Refactor: Deduplication in pagination.py's "Set Elipses Sizes" section #141

Merged
merged 5 commits into from May 8, 2024

Conversation

SylviaSK
Copy link
Contributor

@SylviaSK SylviaSK commented May 5, 2024

Refactors ~200 lines of chained and fairly duplicate if-else's down to ~20 lines.

self.start_ellipses.setMaximumWidth(self.button_size.width())
# I do not know where these magic values were derived from, but
# this is better than the chain elif's that were here before
if page_count >= 8 and page_count <= 11:
Copy link
Collaborator

Choose a reason for hiding this comment

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

just a tiny nitpick

Suggested change
if page_count >= 8 and page_count <= 11:
if 8 <= page_count <= 11:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! I forget python has that, implemented.

@Loran425 Loran425 added the refactor Code that needs to be restructured or cleaned up label May 5, 2024
yedpodtrzitko added a commit to yedpodtrzitko/TagStudio that referenced this pull request May 8, 2024
Copy link
Member

@CyanVoxel CyanVoxel left a comment

Choose a reason for hiding this comment

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

Seems to work just fine! Happy to see this (cursed) section of the program cleaned up!

@CyanVoxel CyanVoxel merged commit f9ea20e into TagStudioDev:main May 8, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Code that needs to be restructured or cleaned up
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants