Skip to content

major OVERHAUL#3

Open
dvdcjw wants to merge 9 commits intoethanedits:mainfrom
dvdcjw:main
Open

major OVERHAUL#3
dvdcjw wants to merge 9 commits intoethanedits:mainfrom
dvdcjw:main

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.

dvdcjw added 9 commits July 14, 2024 08:42
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