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

[FEAT] Add deactivate_buttons() function to Paginators #1681

Closed
1 task done
Donbur4156 opened this issue May 12, 2024 · 0 comments
Closed
1 task done

[FEAT] Add deactivate_buttons() function to Paginators #1681

Donbur4156 opened this issue May 12, 2024 · 0 comments

Comments

@Donbur4156
Copy link
Contributor

Problem Description

To reduce lines of code for switching from buttons to select menu I would recommend to implement a function in Paginators Class.

before:

paginator.show_select_menu = True
paginator.show_back_button = False
paginator.show_first_button = False
paginator.show_next_button = False
paginator.show_last_button = False

after:

paginator.show_select_menu = True
paginator.deactivate_buttons()

Proposed Solution

add following function to Paginators class:

class Paginator:
...
    def deactivate_buttons(self) -> None:
        """
        deactivate all control buttons for `First`, `Back`, `Next`, `Last`.
        """
        self.show_first_button = False
        self.show_back_button = False
        self.show_next_button = False
        self.show_last_button = False
...

Alternatives Considered

No response

Additional Information

PR is ready and will add asap

Code of Conduct

  • I agree to follow the contribution requirements.
@AstreaTSS AstreaTSS closed this as not planned Won't fix, can't repro, duplicate, stale May 21, 2024
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

No branches or pull requests

2 participants