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

Error state re-sets progress to 10% automatically #4

Open
L1-0 opened this issue Jan 25, 2024 · 1 comment
Open

Error state re-sets progress to 10% automatically #4

L1-0 opened this issue Jan 25, 2024 · 1 comment

Comments

@L1-0
Copy link

L1-0 commented Jan 25, 2024

Describe the bug
Somehow the setState 'warning' state behaves differently than the 'error' state.

To Reproduce
I have the following code:

import time
import PyTaskbar
TaskBarStatus = PyTaskbar.Progress()
TaskBarStatus.init()

for i in range(20):
    time.sleep(0.7)
    TaskBarStatus.setProgress(100)
    TaskBarStatus.setState('error')
    time.sleep(0.7)
    TaskBarStatus.setProgress(100)
    TaskBarStatus.setState('warning')
    time.sleep(0.7)
    TaskBarStatus.setState('normal')
    
input("Press Enter to continue...")

Expected behavior
This piece of code should make my taskbar flash red and yellow while keeping the bar full.

Screenshots
Only the yellow warning state is being affected by the previous setProgress instruction.
grafik

Desktop (please complete the following information):

  • OS: Windows 10 (latest updates)
@L1-0
Copy link
Author

L1-0 commented Jan 25, 2024

So this one is on me, it works by setting the progress after setting the state. Still does not explain why i cannot set the progress first but works for me as a solution.

for i in range(20):
    time.sleep(0.7)
    TaskBarStatus.setState('error')
    TaskBarStatus.setProgress(100)
    time.sleep(0.7)
    TaskBarStatus.setState('warning')
    TaskBarStatus.setProgress(100)
    time.sleep(0.7)
    TaskBarStatus.setState('normal')

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

1 participant