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

major OVERHAUL #3

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

major OVERHAUL #3

wants to merge 9 commits into from

Conversation

dvdcjw
Copy link

@dvdcjw dvdcjw commented Jul 15, 2024

made this project way more practical, efficient and maintainable

Alters:

  • Clicking on checkboxes now will not cause the program to sleep for 0.15 seconds.
    Instead, to prevent multi-triggering when held down, the program checks if the checkbox was pressed in the last frame to avoid potential and obvious problems.

  • CALLBACKS

Users no longer need to detect if the button is pressed or if the checkbox is enabled in the main loop.
Instead, users now assign a function to the callback argument when defining the widget.
Once the callback is triggered, the function will be called immediately and automatically.

  • Fixed text for checkboxes and buttons.
    Now, the text argument is usable for checkboxes and buttons.
    When defining, the user would only need to text=str when defining the widget
    Then, the text will automaticly be placed.
    (In the button and beside the checkbox. )

  • Text alignments
    Both horizontal and vertical alignments for text are supported.

  • Fixed multi-triggering
    In the past, the corresponding function would be triggered per frame when a situation was reached (a button was pressed down, a checkbox was checked, etc.).
    Now, with the callback, the required function will only be triggered once (when the button is initially clicked, and once when the checkbox is checked).

  • More managable widgets
    Now, widgets will be saved in a list,
    This enables the library to automatically render them, handle callbacks, and avoid multi-triggering.

  • Code format overhaul
    Optimised the source code to follow PEP8, so it's more maintainable and readable

  • Compatible with previous projects
    Although the new approaches are much more efficient and recommended,
    previous programs using this library will still run smoothly.

This way, the overlay window won't show a icon in taskbar
when checkbox is clicked, check if the cursor is held down continuously ( don't toggle) or it's the first frame of clicking action (toggle). Replaced time.sleep(0.15) for avoiding constant toggle in the left click duration
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.

1 participant